Open ldelossa opened 2 years ago
Interestingly if you do a workspace symbol search based on the call hierarchy item name you get the following results:
containerName = "github.com/ldelossa/calltree-nvim",
kind = 6,
location = {
range = {
end = {
character = 16,
line = 4
},
start = {
character = 12,
line = 4
}
},
uri = "file:///home/louis/git/go/calltree.nvim/main.go"
},
name = "N.DoIt"
}, {
containerName = "github.com/ldelossa/calltree-nvim",
kind = 6,
location = {
range = {
end = {
character = 16,
line = 10
},
start = {
character = 12,
line = 10
}
},
uri = "file:///home/louis/git/go/calltree.nvim/main.go"
},
name = "R.DoIt"
} }
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?
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.