aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-18 17:31:55 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-18 17:31:55 +0900
commit978d09ad437fcc71d0bc928a10436dbfd537d401 (patch)
tree4209de8acef065cd369ecd17953b1b27fdecd1f8
parent42b7d395f17c1b677a53d8bec593365614e3ea7c (diff)
downloadvim-lsp-settings-978d09ad437fcc71d0bc928a10436dbfd537d401.tar.gz
vim-lsp-settings-978d09ad437fcc71d0bc928a10436dbfd537d401.tar.bz2
vim-lsp-settings-978d09ad437fcc71d0bc928a10436dbfd537d401.zip
If the default server is specified as list, continue to look next
-rw-r--r--autoload/lsp_settings.vim21
-rw-r--r--settings.json12
2 files changed, 30 insertions, 3 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index d9a6a5b..f1b163e 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -391,6 +391,8 @@ function! s:vim_lsp_load_or_suggest(ft) abort
command! -nargs=1 LspRegisterServer autocmd User lsp_setup call lsp#register_server(<args>)
endif
+ let l:default = get(g:, 'lsp_settings_' . a:ft, '')
+
let l:found = 0
let l:disabled = 0
@@ -399,10 +401,19 @@ function! s:vim_lsp_load_or_suggest(ft) abort
let l:disabled += 1
continue
endif
- let l:default = get(g:, 'lsp_settings_' . a:ft, '')
- if !empty(l:default) && l:default != l:server.command
+
+ if type(l:default) ==# v:t_list
+ if len(l:default) ># 0 && index(l:default, l:server.command) == -1
+ continue
+ endif
+ elseif type(l:default) ==# v:t_string
+ if !empty(l:default) && l:default != l:server.command
+ continue
+ endif
+ else
continue
endif
+
let l:command = lsp_settings#get(l:server.command, 'cmd', [])
if empty(l:command) && !lsp_settings#executable(l:server.command)
let l:script = printf('%s/%s.vim', s:checkers_dir, l:server.command)
@@ -429,7 +440,11 @@ function! s:vim_lsp_load_or_suggest(ft) abort
exe 'source' l:script
let l:found += 1
let s:ftmap[a:ft] = 1
- break
+
+ " If default server is specified as list, continue to look next.
+ if type(l:default) !=# v:t_list
+ break
+ endif
endif
endfor
diff --git a/settings.json b/settings.json
index 046f307..7847d2b 100644
--- a/settings.json
+++ b/settings.json
@@ -241,6 +241,12 @@
"requires": [
"npm"
]
+ },
+ {
+ "command": "eslint-language-server",
+ "requires": [
+ "git", "npm"
+ ]
}
],
"javascriptreact": [
@@ -554,6 +560,12 @@
"requires": [
"npm"
]
+ },
+ {
+ "command": "eslint-language-server",
+ "requires": [
+ "git", "npm"
+ ]
}
],
"typescriptreact": [