install.fairie/dotfiles/.vim/plugged/ale/ale_linters/svelte/svelteserver.vim
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

21 lines
817 B
VimL

" 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',
\ 'executable': {b -> ale#path#FindExecutable(b, 'svelte_svelteserver', [
\ 'node_modules/.bin/svelteserver',
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#svelte#svelteserver#GetProjectRoot'),
\})