oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.28k stars 39 forks source link

My LSP client doesn't support confirmation error #131

Open heitorPB opened 4 months ago

heitorPB commented 4 months ago

I'm trying to setup nil in NeoVim but I'm getting this message whenever I open NeoVim: Your LSP client doesn't support confirmation. You can enable autoArchive in lsp configuration.

Here's my configuration:

autostart = true,
capabilities = caps,
cmd = { "nil" },
settings = {
    ["nil"] = {
      formatting = { command = { "nix fmt" }, },
      nix = { flake = { autoArchive = true }, },
    },
},

Running nil 2023-08-09.

What am I missing here?

leoperegrino commented 1 month ago

Same thing here

leoperegrino commented 1 month ago

Ok, I've just managed to solve it thanks to this random git commit I've found on google. The solutions lies in changing the lspconfig parameters of the nil_ls server. Documentation can also be found here.

require('lspconfig').nil_ls.setup {
  settings = {
    nix = {
      flake = {
        -- calls `nix flake archive` to put a flake and its output to store
        autoArchive = true,
      },
    },
  },
}