Skip to content

Commit

Permalink
Merge pull request #606 from iynaix/add-nixd-opts
Browse files Browse the repository at this point in the history
languages/nix: add lsp options support for nixd
  • Loading branch information
NotAShelf authored Feb 11, 2025
2 parents c4cb29b + 6d7b8ec commit ae677ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,8 @@
[nezia1](https://github.com/nezia1)

- Add support for [nixd](https://github.com/nix-community/nixd) language server.

[iynaix](https://github.com/iynaix)

- Add lsp options support for [nixd](https://github.com/nix-community/nixd)
language server.
11 changes: 9 additions & 2 deletions modules/plugins/languages/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.strings) optionalString;
inherit (lib.types) enum either listOf package str;
inherit (lib.types) anything attrsOf enum either listOf nullOr package str;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.lua) expToLua toLuaObject;
inherit (lib.nvim.languages) diagnosticsToLua;

cfg = config.vim.languages.nix;
Expand Down Expand Up @@ -87,6 +87,7 @@
command = {"${cfg.format.package}/bin/nixfmt"},
},
''}
options = ${toLuaObject cfg.lsp.options},
},
},
''}
Expand Down Expand Up @@ -173,6 +174,12 @@ in {
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
};

options = mkOption {
type = nullOr (attrsOf anything);
default = null;
description = "Options to pass to nixd LSP server";
};
};

format = {
Expand Down

0 comments on commit ae677ce

Please sign in to comment.