update:support overload anonymous member reference#276
Open
luoliwoshang wants to merge 2 commits intogoplus:goplusfrom
Open
update:support overload anonymous member reference#276luoliwoshang wants to merge 2 commits intogoplus:goplusfrom
luoliwoshang wants to merge 2 commits intogoplus:goplusfrom
Conversation
5317937 to
a11f2ac
Compare
a11f2ac to
c1dfaa9
Compare
4f8fe0b to
2cbaf58
Compare
2cbaf58 to
1d226a1
Compare
1d226a1 to
44fc0ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #269

Old implementation only handled named nodes, didn’t locate
FuncLit, and didn’t collect anonymous-function targets, so it couldn’t find references to overloaded anonymous functions.Locate the node: Find the AST node at the given cursor position.
New: also treat ast.FuncLit (anonymous functions) as a valid target.
Build targets: Use types.Info to map that node to one or more types.Object, and add any anonymous overload instances for FuncLit into the targets set.
Traverse package ASTs: In parallel, walk every AST node in each package, use types.Info.Uses/Defs to get each node’s types.Object, and compare against targets; report any matches as references.
Implementation details:
https://m1utligoytg.feishu.cn/wiki/QSzVwgWGaiwF6Ak8kL1cNc5mn6d?from=from_copylink