How do I enable gopls staticcheck capabilities?
#4343
Answered
by
cookesan
TheLambdaFunction
asked this question in
Q&A
-
|
Sorry if I'm asking something super-trivial, but I'm having a hard time figuring this out |
Beta Was this translation helpful? Give feedback.
Answered by
cookesan
May 25, 2026
Replies: 1 comment
-
|
For the current Nixvim LSP options, put it under the server's plugins.lsp = {
enable = true;
servers.gopls = {
enable = true;
settings = {
gopls = {
staticcheck = true;
};
};
};
};If you are using the newer lsp.servers.gopls = {
enable = true;
config.settings = {
gopls = {
staticcheck = true;
};
};
};The reason for the extra :lua print(vim.inspect(vim.lsp.get_clients({ name = "gopls" })[1].config.settings)) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TheLambdaFunction
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the current Nixvim LSP options, put it under the server's
settingspayload and keep thegoplsnesting:If you are using the newer
lsp.serversinterface directly, the same setting goes underconfig.settings:The reason for the extra
goplslevel is that this is the shape the Go language server expects in its settings object. You can confirm what Neovim received with: