gopls
, the Go language serverNote: gopls
only supports Go versions above 1.11.
Ideally, you would see prompts to use/install/update the language server. Follow the prompts and the language server should get set up correctly. If you want to manually install/update the language server,
go.useLanguageServer
to true
in your settingsGo: Install/Update Tools
command, select gopls
from the list and press Ok.Below are the settings you can use to control the use of the language server. You need to reload the VS Code window for any changes in these settings to take effect.
go.useLanguageServer
to true
to enable the use of language server.gopls
, see the recommended settings.go.languageServerExperimentalFeatures
. Below are the features you can thus control. By default, all are set to true
i.e are enabled."go.languageServerExperimentalFeatures": { "diagnostics": true, "documentLink": true }
"go.languageServerFlags": ["-logfile", "path to a text file that exists"]
to collect logs in a log file."go.languageServerFlags": ["-rpc.trace"]
to see the complete rpc trace in the output panel (View
-> Output
-> gopls
)If you find any problems using the gopls
language server, please first check the list of existing issues for gopls and update the relevant ones with your case before logging a new one at https://github.com/golang/go/issues