Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update:support overload declaration reference #270

Open
wants to merge 3 commits into
base: goplus
Choose a base branch
from

Conversation

luoliwoshang
Copy link

@luoliwoshang luoliwoshang commented Apr 29, 2024

#269
Implementation details:
https://m1utligoytg.feishu.cn/wiki/QSzVwgWGaiwF6Ak8kL1cNc5mn6d?from=from_copylink

image

  • Wait for the above PR to merge, then modify the gop version in tools.
    Support for overload function find references

Option 1

Multiple overloaded functions corresponding to use ident are stored in the TypeInfo of Go+, so in the search of reference, it is determined whether the type corresponding to the Ident calling the overloaded function is a function type of the overloaded function. If it is one of the overloaded functions, then according to the name of the overloaded function, the declaration of the overloaded function is obtained and replaced with the object compared with target, that is, the overloaded function corresponding to the overloaded declaration can be found.

Defect

TypeInfo does not directly store the types declared by Overload functions corresponding to Ident, but stores multiple overloaded function members corresponding to Ident, resulting in redundant logic

Improve

Modify the typesutil.Overloads from multiple overloaded members corresponding to Ident to the corresponding overloaded declaration, and provide a function to obtain the actual overloaded member function corresponding to the Ident

@luoliwoshang luoliwoshang changed the title update:support overload function reference [WIP] update:support overload function reference Apr 29, 2024
@luoliwoshang luoliwoshang force-pushed the overload-reference branch 3 times, most recently from 11c9d16 to 107171f Compare April 30, 2024 03:09
@luoliwoshang luoliwoshang changed the title [WIP] update:support overload function reference update:support overload function reference May 3, 2024
@luoliwoshang luoliwoshang changed the title update:support overload function reference update:support overload decl reference May 8, 2024
@luoliwoshang luoliwoshang changed the title update:support overload decl reference update:support overload declaration reference May 8, 2024
@luoliwoshang luoliwoshang force-pushed the overload-reference branch 2 times, most recently from b578260 to ffe6f59 Compare May 27, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants