-
Notifications
You must be signed in to change notification settings - Fork 89
go-langserver doesn't work when editing a package outside of the gopath #185
Comments
Any updates on this? |
cc @slimsag |
@keegancsmith what are your thoughts on this issue? I looked into the referenced issue and I can imagine two scenarios:
I don't think we can support the latter case feasibly because of our reliance on I tried it out just now on github.com/gorilla/mux outside my $GOPATH, and hover/definition work OK with the godef-based implementation. But find all references and symbol search ( |
I think hover/def didn't work before your godef change. Just that working may be sufficient. The workspace operations won't really work, since in general we need to know the package name a file lives in, and without a GOPATH we don't. However, we can do best effort for */symbol since all that really relies on is parsing the AST. For references I don't think we could reasonably support that without knowing the real package name for a file. Technically we could support references within the same package, but not sure the cost of implementing that is worth it. |
A more useful thing we could do is warn the user they are outside a GOPATH, and possibly provide an action to autoconfigure (find /src/ in a parent directory). I think that would have to be done in the extension, rather than in server. |
This adds support for "go-langserver". At this moment, it is possible to "Go to definition". For best results, GOPATH needs to be set, see: sourcegraph/go-langserver#185 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This adds support for "go-langserver". At this moment, it is possible to "Go to definition". For best results, GOPATH needs to be set, see: sourcegraph/go-langserver#185 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This adds support for "go-langserver". At this moment, it is possible to "Go to definition". For best results, GOPATH needs to be set, see: sourcegraph/go-langserver#185 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
See original issue in vscode-go microsoft/vscode-go#886
The text was updated successfully, but these errors were encountered: