Skip to content

Commit c4ec868

Browse files
authored
feat(lsp-nix): Allow passing arguments to server (#4728)
Signed-off-by: Julia DeMille <[email protected]>
1 parent bb01be1 commit c4ec868

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.org

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* Add support for [[https://github.com/mathworks/MATLAB-language-server][MATLAB language server]] (requires [[https://github.com/MathWorks/Emacs-MATLAB-Mode][matlab-mode]]).
3535
* Add support for [[https://github.com/c3lang/c3c][c3 language]] (requires [[https://github.com/c3lang/c3-ts-mode][c3-ts-mode]] and [[https://github.com/pherrymason/c3-lsp][c3lsp]]).
3636
* Drop support for emacs 27.1 and 27.2
37+
* Add ~lsp-nix-nixd-server-arguments~ to allow passing arguments to the ~nixd~ LSP.
3738

3839
** 9.0.0
3940
* Add language server config for QML (Qt Modeling Language) using qmlls.

clients/lsp-nix.el

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
:type 'string
5555
:package-version '(lsp-mode . "8.0.0"))
5656

57+
(defcustom lsp-nix-nixd-server-arguments '()
58+
"Extra arguments for the server."
59+
:group 'lsp-nix-nixd
60+
:type '(repeat string)
61+
:package-version '(lsp-mode . "9.0.1"))
62+
5763
(lsp-defcustom lsp-nix-nixd-formatting-command nil
5864
"External formatter command with arguments.
5965
@@ -98,7 +104,7 @@
98104
:package-version '(lsp-mode . "9.0.1"))
99105

100106
(lsp-register-client
101-
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nix-nixd-server-path))
107+
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () (push lsp-nix-nixd-server-path lsp-nix-nixd-server-arguments)))
102108
:major-modes '(nix-mode nix-ts-mode)
103109
:initialized-fn (lambda (workspace)
104110
(with-lsp-workspace workspace

0 commit comments

Comments
 (0)