Skip to content

Commit 81c2984

Browse files
authored
suggestion: use nixd language server, priority over rnix (#4288)
* use `nixd` language server, priority over `rnix` `nixd` is more actively maintained than `rnix` https://github.com/nix-community/nixd https://github.com/nix-community/rnix-lsp #4168 * nixd documentation https://github.com/nix-community/nixd/blob/main/nixd/docs/user-guide.md#installation
1 parent 9ce271b commit 81c2984

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

clients/lsp-nix.el

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@
4141
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nix-rnix-server-path))
4242
:major-modes '(nix-mode nix-ts-mode)
4343
:server-id 'rnix-lsp
44+
:priority -2))
45+
46+
(defgroup lsp-nix-nixd nil
47+
"LSP support for Nix, using nixd language server."
48+
:group 'lsp-mode
49+
:link '(url-link "https://github.com/nix-community/nixd"))
50+
51+
(defcustom lsp-nix-nixd-server-path "nixd"
52+
"Executable path for the server."
53+
:group 'lsp-nix-nixd
54+
:type 'string
55+
:package-version '(lsp-mode . "8.0.0"))
56+
57+
(lsp-register-client
58+
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nix-nixd-server-path))
59+
:major-modes '(nix-mode)
60+
:server-id 'nixd-lsp
4461
:priority -1))
4562

4663
(defgroup lsp-nix-nil nil

docs/lsp-clients.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,18 @@
614614
},
615615
{
616616
"name": "nix",
617-
"full-name": "Nix",
617+
"full-name": "Nix (nixd language server)",
618+
"server-name": "nixd",
619+
"server-url": "https://github.com/nix-community/nixd",
620+
"installation": "nix profile install github:nixos/nixpkgs#nixd",
621+
"debugger": "Not available"
622+
},
623+
{
624+
"name": "nix",
625+
"full-name": "Nix (rnix language server)",
618626
"server-name": "rnix-lsp",
619627
"server-url": "https://github.com/nix-community/rnix-lsp",
620-
"installation": "nix-env -i rnix-lsp",
628+
"installation": "nix profile install github:nixos/nixpkgs#rnix-lsp",
621629
"debugger": "Not available"
622630
},
623631
{

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ nav:
108108
- MSSQL: https://emacs-lsp.github.io/lsp-mssql
109109
- Nginx: page/lsp-nginx.md
110110
- Nim: page/lsp-nim.md
111+
- Nix (nixd-lsp): page/lsp-nix.md
111112
- Nix (rnix-lsp): page/lsp-nix.md
112113
- Nix (nil): page/lsp-nix-nil.md
113114
- OCaml (ocaml-lsp): page/lsp-ocaml-lsp-server.md

0 commit comments

Comments
 (0)