Skip to content

update:support overload anonymous member reference #276

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

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

Conversation

luoliwoshang
Copy link
Member

@luoliwoshang luoliwoshang commented May 8, 2024

fix #269
image

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

@luoliwoshang luoliwoshang force-pushed the overload-anony-reference branch from 5317937 to a11f2ac Compare May 8, 2024 09:39
@luoliwoshang luoliwoshang changed the title update:support overload anonymous member reference [wip] update:support overload anonymous member reference May 8, 2024
@luoliwoshang luoliwoshang force-pushed the overload-anony-reference branch from a11f2ac to c1dfaa9 Compare May 9, 2024 07:09
@luoliwoshang luoliwoshang changed the title [wip] update:support overload anonymous member reference update:support overload anonymous member reference May 9, 2024
@luoliwoshang luoliwoshang force-pushed the overload-anony-reference branch 2 times, most recently from 4f8fe0b to 2cbaf58 Compare May 13, 2024 14:04
@luoliwoshang luoliwoshang force-pushed the overload-anony-reference branch from 2cbaf58 to 1d226a1 Compare May 27, 2024 07:24
@luoliwoshang luoliwoshang force-pushed the overload-anony-reference branch from 1d226a1 to 44fc0ce Compare May 27, 2024 07:40
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.

feat:support overload reference
1 participant