Merge pull request #3556 from jD91mZM2/rnix

Add rnix-lsp for Nix diagnostics and completion
This commit is contained in:
Horacio Sanson 2021-01-23 21:50:36 +09:00 committed by GitHub
commit 9fd9435cd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,16 @@
" Author: jD91mZM2 <me@krake.one>
" Description: rnix-lsp language client
function! ale_linters#nix#rnix_lsp#GetProjectRoot(buffer) abort
" rnix-lsp does not yet use the project root, so getting it right is not
" important
return fnamemodify(a:buffer, ':h')
endfunction
call ale#linter#Define('nix', {
\ 'name': 'rnix_lsp',
\ 'lsp': 'stdio',
\ 'executable': 'rnix-lsp',
\ 'command': '%e',
\ 'project_root': function('ale_linters#nix#rnix_lsp#GetProjectRoot'),
\})

View file

@ -310,6 +310,7 @@ Notes:
* nix
* `nix-instantiate`
* `nixpkgs-fmt`
* `rnix-lsp`
* nroff
* `alex`!!
* `proselint`

View file

@ -319,6 +319,7 @@ formatting.
* nix
* [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate)
* [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt)
* [rnix-lsp](https://github.com/nix-community/rnix-lsp)
* nroff
* [alex](https://github.com/wooorm/alex) :floppy_disk:
* [proselint](http://proselint.com/)

0
test/nix/test.nix Normal file
View file

View file

@ -0,0 +1,14 @@
" Author: jD91mZM2 <me@krake.one>
" Description: Tests for rnix-lsp language client
Before:
call ale#assert#SetUpLinterTest('nix', 'rnix_lsp')
After:
call ale#assert#TearDownLinterTest()
Execute(should start rnix-lsp):
call ale#test#SetFilename('./test.nix')
AssertLSPLanguage 'nix'
AssertLSPOptions {}
AssertLSPProject ale#path#Simplify('.')