Merge pull request #3556 from jD91mZM2/rnix
Add rnix-lsp for Nix diagnostics and completion
This commit is contained in:
commit
9fd9435cd5
5 changed files with 32 additions and 0 deletions
16
ale_linters/nix/rnix_lsp.vim
Normal file
16
ale_linters/nix/rnix_lsp.vim
Normal 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'),
|
||||
\})
|
|
@ -310,6 +310,7 @@ Notes:
|
|||
* nix
|
||||
* `nix-instantiate`
|
||||
* `nixpkgs-fmt`
|
||||
* `rnix-lsp`
|
||||
* nroff
|
||||
* `alex`!!
|
||||
* `proselint`
|
||||
|
|
|
@ -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
0
test/nix/test.nix
Normal file
14
test/nix/test_rnix_lsp.vader
Normal file
14
test/nix/test_rnix_lsp.vader
Normal 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('.')
|
Reference in a new issue