go-langserver
go-langserver copied to clipboard
No symbols for file when methods are on a type defined in another file
In a package have 2 Go files
The first file:
package main
func main() {}
type foo int
The second file:
package main
func (*foo) Hello() {}
func (*foo) Bye() {}
The symbol provider doesnt provide any symbols for the second file.
cc @harikb Related to https://github.com/Microsoft/vscode-go/issues/1864
https://github.com/sourcegraph/go-langserver/blob/7df19dc017efdd578d75c81016e0b512f3914cc1/langserver/langserver_test.go#L1085-L1101
There is already a test case for this. Do you mean that in both files the symbols request should return Hello and Bye?
Do you mean that in both files the symbols request should return Hello and Bye?
No. What we saw was there were no symbols being returned in the second file.
@harikb Can you update your language server and try again? To avoid the case that you have an older version of the tool?
@ramya-rao-a , it does seem to work after I updated the language server. I did not remember that language-server was installed via a separate go get command. Sorry about this. Although the UI appears slightly different. I guess that may be the difference with langage-server mode.
With language-server

With-out language-server

NOTE: The syntax error (red underline) shown on package main line is because of https://github.com/Microsoft/vscode-go/issues/1914 (unrelated to this issue). At the moment, vs code won't work for me until that is fixed. I will update this ticket after that spurious error is resolved.