mirror of
https://github.com/dense-analysis/ale
synced 2025-01-14 19:14:58 +00:00
be69af2705
Default `g:ale_disable_lsp` to a new mode `'auto'` by default. With this setting applied, ALE will now check for the presence of nvim-lspconfig and automatically turn off particular LSP linters if already configured via nvim-lspconfig. For users that do not use `nvim-lspconfig`, everything should work as before.
18 lines
513 B
VimL
18 lines
513 B
VimL
" 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',
|
|
\ 'aliases': ['rnix'],
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable': 'rnix-lsp',
|
|
\ 'command': '%e',
|
|
\ 'project_root': function('ale_linters#nix#rnix_lsp#GetProjectRoot'),
|
|
\})
|