Skip to content

[BUG] typos_lsp: settings are not applied correctly #3632

@demenik

Description

@demenik

Plugin

lsp

Nixpkgs Release

unstable

Home Manager Release

unstable

I have read the FAQ

  • I have read the FAQ and my bug is not listed there.

Description

I tried changing the diagnostic severity of typos_lsp (see typos_lsp docs) using the init_options.diagnosticSeverity option. Nixvim only allows me to put that in plugins.lsp.servers.typos_lsp.settings, which results in the following init.lua code:

-- ...
local __lspServers = {
  -- ...
  { extraOptions = { settings = { init_options = { diagnosticSeverity = "Info" } } }, name = "typos_lsp" },
  -- ...
}
-- ...

This doesn't work, because the value of extraOptions is getting passed to require("lspconfig")[server.name].setup(options). That means the options in setup look like { settings = { init_options = { ... } } } while they have to look like { init_options = { ... } }.

Minimal, Reproducible Example (MRE)

programs.nixvim.plugins.lsp.servers.typos_lsp = {
  enable = true;
  settings.init_options.diagnosticSeverity = "Hint";
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions