aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-24 12:52:35 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-24 12:52:35 +0900
commite046c719864355821e52595c110b9798a715f8b3 (patch)
tree635a6befe2308914ee6528393499174645139fd6 /plugin
parent8c6b4c326de02c27b9727e3f711bf17ba124efbd (diff)
downloadvim-lsp-settings-e046c719864355821e52595c110b9798a715f8b3.tar.gz
vim-lsp-settings-e046c719864355821e52595c110b9798a715f8b3.tar.bz2
vim-lsp-settings-e046c719864355821e52595c110b9798a715f8b3.zip
Support efm-langserver
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lsp_settings.vim19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim
index 06969b0..2b3346e 100644
--- a/plugin/lsp_settings.vim
+++ b/plugin/lsp_settings.vim
@@ -32,8 +32,8 @@ function! s:executable(cmd) abort
return 0
endfunction
-function! s:vimlsp_installer() abort
- let l:ft = tolower(split(&filetype, '\.')[0])
+function! s:vimlsp_installer(ft) abort
+ let l:ft = tolower(split(a:ft, '\.')[0])
if !has_key(s:settings, l:ft)
return []
endif
@@ -96,8 +96,8 @@ function! s:vimlsp_install_server_post(command, job, code, ...) abort
endif
endfunction
-function! s:vimlsp_install_server() abort
- let l:entry = s:vimlsp_installer()
+function! s:vimlsp_install_server(ft) abort
+ let l:entry = s:vimlsp_installer(a:ft)
if empty(l:entry)
return
endif
@@ -119,8 +119,8 @@ function! s:vimlsp_install_server() abort
endif
endfunction
-function! s:vimlsp_settings_suggest() abort
- if empty(s:vimlsp_installer())
+function! s:vimlsp_settings_suggest(ft) abort
+ if empty(s:vimlsp_installer(a:ft))
return
endif
if exists(':LspInstallServer') !=# 2
@@ -128,7 +128,7 @@ function! s:vimlsp_settings_suggest() abort
echohl Directory
echomsg 'If enable Language Server, please do :LspInstallServer'
echohl None
- command! -buffer LspInstallServer call s:vimlsp_install_server()
+ command! -buffer LspInstallServer call s:vimlsp_install_server(&l:filetype)
endif
endfunction
@@ -246,11 +246,11 @@ function! s:vimlsp_load_or_suggest(ft) abort
endfor
if l:found ==# 0
- call s:vimlsp_settings_suggest()
+ call s:vimlsp_settings_suggest(a:ft)
else
doautocmd User lsp_setup
if exists(':LspInstallServer') !=# 2
- command! -buffer LspInstallServer call s:vimlsp_install_server()
+ command! -buffer LspInstallServer call s:vimlsp_install_server(&l:filetype)
endif
endif
@@ -264,3 +264,4 @@ function! s:load_or_suggest_group_name(ft) abort
endfunction
call s:vimlsp_setting()
+call s:vimlsp_load_or_suggest('_')