Add build tag support for "Go to Definition" feature
See https://github.com/Microsoft/vscode-go/issues/1024
The language server doesnt return definition location when there is a build tag in the file
@ramya-rao-a we actually support an unofficial extension to LSP to specify the build tags to use https://sourcegraph.com/github.com/sourcegraph/go-langserver/-/blob/langserver/lspx.go#L41
So your initialize request would additionally specify something like
{
...
"BuildContext": {
"BuildTags": ["integration"]
}
}
Am not sure how to include that when creating the language client.
I can set the intializationOptions which you will get in https://sourcegraph.com/github.com/sourcegraph/go-langserver/-/blob/pkg/lsp/service.go#L18:2
@ramya-rao-a To clarify what @keegancsmith said above a bit, you would specify the initializationOptions like this:
"initializationOptions": {
...your existing initialization options...
"BuildContext": {
"BuildTags": ["integration"]
}
}
That is to say, the language server supports an unofficial extension to LSP where you can specify that BuildContext field in the initializationOptions field you normally sent on LSP client init.