Skip to content
Discussion options

You must be logged in to vote

For the current Nixvim LSP options, put it under the server's settings payload and keep the gopls nesting:

plugins.lsp = {
  enable = true;
  servers.gopls = {
    enable = true;
    settings = {
      gopls = {
        staticcheck = true;
      };
    };
  };
};

If you are using the newer lsp.servers interface directly, the same setting goes under config.settings:

lsp.servers.gopls = {
  enable = true;
  config.settings = {
    gopls = {
      staticcheck = true;
    };
  };
};

The reason for the extra gopls level is that this is the shape the Go language server expects in its settings object. You can confirm what Neovim received with:

:lua print(vim.inspect(vim.lsp.get_clients({ name = "g…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheLambdaFunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants