2018-07-05 12:04:20 +00:00
|
|
|
" 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',
|
2023-09-13 23:38:12 +00:00
|
|
|
\ 'aliases': ['vuels'],
|
2018-07-05 12:04:20 +00:00
|
|
|
\ 'lsp': 'stdio',
|
2021-05-26 21:43:30 +00:00
|
|
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'vue_vls', [
|
2018-08-02 22:44:12 +00:00
|
|
|
\ 'node_modules/.bin/vls',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ ])},
|
2018-08-02 22:44:12 +00:00
|
|
|
\ 'command': '%e --stdio',
|
2018-07-05 12:04:20 +00:00
|
|
|
\ 'language': 'vue',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'project_root': function('ale_linters#vue#vls#GetProjectRoot'),
|
2018-07-05 12:04:20 +00:00
|
|
|
\})
|