1
0
Fork 0
mirror of synced 2024-12-23 07:20:42 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/svelte/svelteserver.vim

22 lines
817 B
VimL
Raw Normal View History

2021-05-05 04:25:00 -04:00
" Author: Joakim Repomaa <joakim@repomaa.com>
" Description: Svelte Language Server integration for ALE
call ale#Set('svelte_svelteserver_executable', 'svelteserver')
call ale#Set('svelte_svelteserver_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#svelte#svelteserver#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('svelte', {
\ 'name': 'svelteserver',
\ 'lsp': 'stdio',
2021-05-31 16:30:26 -04:00
\ 'executable': {b -> ale#path#FindExecutable(b, 'svelte_svelteserver', [
2021-05-05 04:25:00 -04:00
\ 'node_modules/.bin/svelteserver',
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#svelte#svelteserver#GetProjectRoot'),
\})