mirror of
https://github.com/dense-analysis/ale
synced 2024-12-11 00:46:31 +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.
24 lines
788 B
VimL
24 lines
788 B
VimL
" Author: Alexander Olofsson <alexander.olofsson@liu.se>
|
|
" Description: Vue vls Language Server integration for ALE
|
|
|
|
call ale#Set('vue_vls_executable', 'vls')
|
|
call ale#Set('vue_vls_use_global', get(g:, 'ale_use_global_executables', 0))
|
|
|
|
function! ale_linters#vue#vls#GetProjectRoot(buffer) abort
|
|
let l:package_path = ale#path#FindNearestFile(a:buffer, 'package.json')
|
|
|
|
return !empty(l:package_path) ? fnamemodify(l:package_path, ':h') : ''
|
|
endfunction
|
|
|
|
call ale#linter#Define('vue', {
|
|
\ 'name': 'vls',
|
|
\ 'aliases': ['vuels'],
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'vue_vls', [
|
|
\ 'node_modules/.bin/vls',
|
|
\ ])},
|
|
\ 'command': '%e --stdio',
|
|
\ 'language': 'vue',
|
|
\ 'project_root': function('ale_linters#vue#vls#GetProjectRoot'),
|
|
\})
|