Crates.io | rnix-lsp |
lib.rs | rnix-lsp |
version | 0.2.5 |
source | src |
created_at | 2020-01-12 10:19:19.129669 |
updated_at | 2022-06-14 11:06:10.405426 |
description | A work-in-progress language server for Nix, with syntax checking and basic completion |
homepage | |
repository | https://github.com/nix-community/rnix-lsp |
max_upload_size | |
id | 197815 |
size | 81,612 |
A syntax-checking language server using rnix.
This is beta-level quality at best - I didn't expect maintaining a language server when writing rnix, the goal was that others would flock around the parser and write a bunch of editor tooling :)
Breakages are expected. No semver compatibility before 1.x.y.
Turn on logging with RUST_LOG=trace
, and redirect stderr to a file.
bash -c "env RUST_LOG=trace rnix-lsp 2> /tmp/rnix-lsp.log"
$ nix-env -i -f https://github.com/nix-community/rnix-lsp/archive/master.tar.gz
These instructions are not fully tested - see issue #3. Please raise an issue and/or send a PR if a config below didn't work out of the box.
{
"languageserver": {
"nix": {
"command": "rnix-lsp",
"filetypes": [
"nix"
]
}
}
}
let g:LanguageClient_serverCommands = {
\ 'nix': ['rnix-lsp']
\ }
if executable('rnix-lsp')
au User lsp_setup call lsp#register_server({
\ 'name': 'rnix-lsp',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'rnix-lsp']},
\ 'whitelist': ['nix'],
\ })
endif
(add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
:major-modes '(nix-mode)
:server-id 'nix))
(add-to-list 'eglot-server-programs '(nix-mode . ("rnix-lsp")))
kak-lsp has builtin configuration since version v9.0.0:
[language.nix]
filetypes = ["nix"]
roots = ["flake.nix", "shell.nix", ".git"]
command = "rnix-lsp"
If you run into an issue regarding "missing roots" see this issue.
{
"nix.enableLanguageServer": true
}
Sadly, the original author of this project, @jD91mZM2 has passed away. His online presence was anonymous and what we have left is his code. This is but one of his many repos that he contributed to.