X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/vue/vls.vim?ds=sidebyside diff --git a/.vim/bundle/ale/ale_linters/vue/vls.vim b/.vim/bundle/ale/ale_linters/vue/vls.vim new file mode 100644 index 00000000..009effd0 --- /dev/null +++ b/.vim/bundle/ale/ale_linters/vue/vls.vim @@ -0,0 +1,23 @@ +" Author: Alexander Olofsson +" 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'), +\})