-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
x/tools/gopls: disambiguate same method names in Call Hierarchy results #49690
Comments
Interestingly if you do a workspace symbol search based on the call hierarchy item name you get the following results:
Would it be possible to use the same object identity (name,kind) so that a workspace symbol can be looked up from a call hierarchy item without ambiguity? |
after researching #10 a bit more I found that certain LSPs (gopls here) provides more accurate symbol information via a workspace symbol query. it would be nice to receieve the same symbol info regardless of the lsp method being used. see: golang/go#49690 this pr now resolves the workspace symbol for all call hierarchy items placed into the tree. this is a bit slower (with gopls anyway) on start, however I've found that after some caching the results are snappy. Signed-off-by: ldelossa <louis.delos@gmail.com>
after researching #10 a bit more I found that certain LSPs (gopls here) provides more accurate symbol information via a workspace symbol query. it would be nice to receieve the same symbol info regardless of the lsp method being used. see: golang/go#49690 this pr now resolves the workspace symbol for all call hierarchy items placed into the tree. this is a bit slower (with gopls anyway) on start, however I've found that after some caching the results are snappy. Signed-off-by: ldelossa <louis.delos@gmail.com>
after researching #10 a bit more I found that certain LSPs (gopls here) provides more accurate symbol information via a workspace symbol query. it would be nice to receieve the same symbol info regardless of the lsp method being used. see: golang/go#49690 this pr now resolves the workspace symbol for all call hierarchy items placed into the tree. this is a bit slower (with gopls anyway) on start, however I've found that after some caching the results are snappy. Signed-off-by: ldelossa <louis.delos@gmail.com>
Agree that it would be nice to share the symbol name presentation whenever possible - currently they don't share much. Relevant code place: call hierarchy's name formatting |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Using latest version
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a source file like this:
I perform an "incoming calls" request on the symbol Func1 inside the main function.
Gopls returns this output (in lua table syntax, can assume the json)
As you can see both "DoIt" methods are shown with no details about the owning structure, or at least, the function's receiver.
What did you expect to see?
LSP call hierarchy items which represent methods should indicate their receivers/owning structures. This can be as simple as having the name field return "func (*R) DoIt" in my example.
What did you see instead?
Instead, gopls returns results which to the viewer/ui look ambiguous. Both returned "DoIt" functions make no mention that they are different functions with different owning structs.
The text was updated successfully, but these errors were encountered: