mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-07 09:33:23 +00:00
languages/nix: add nixd
This adds the [nixd](https://github.com/nix-community/nixd) language server.
This commit is contained in:
parent
a6d9e75f37
commit
132c3da8ec
2 changed files with 38 additions and 0 deletions
|
@ -139,3 +139,7 @@
|
|||
|
||||
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
|
||||
Inspiration from `vim.languages.clang.dap` implementation.
|
||||
|
||||
[nezia1](https://github.com/nezia1)
|
||||
|
||||
- Add support for [nixd](https://github.com/nix-community/nixd) language server.
|
||||
|
|
|
@ -59,6 +59,40 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nixd = {
|
||||
package = pkgs.nixd;
|
||||
internalFormatter = true;
|
||||
lspConfig = ''
|
||||
lspconfig.nixd.setup{
|
||||
capabilities = capabilities,
|
||||
${
|
||||
if cfg.format.enable
|
||||
then useFormat
|
||||
else noFormat
|
||||
},
|
||||
cmd = ${packageToCmd cfg.lsp.package "nixd"},
|
||||
${optionalString cfg.format.enable ''
|
||||
settings = {
|
||||
nixd = {
|
||||
${optionalString (cfg.format.type == "alejandra")
|
||||
''
|
||||
formatting = {
|
||||
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
|
||||
},
|
||||
''}
|
||||
${optionalString (cfg.format.type == "nixfmt")
|
||||
''
|
||||
formatting = {
|
||||
command = {"${cfg.format.package}/bin/nixfmt"},
|
||||
},
|
||||
''}
|
||||
},
|
||||
},
|
||||
''}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "alejandra";
|
||||
|
|
Loading…
Add table
Reference in a new issue