aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/lsp_settings.vim2
-rw-r--r--test/lsp_settings.vimspec12
2 files changed, 13 insertions, 1 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 07feb8b..9762f6b 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -405,7 +405,7 @@ function! lsp_settings#init() abort
endif
exe 'augroup' lsp_settings#utils#group_name(l:ft)
autocmd!
- exe 'autocmd FileType' l:ft 'call s:vim_lsp_load_or_suggest(' string(l:ft) ')'
+ exe 'autocmd FileType' l:ft printf("call s:vim_lsp_load_or_suggest('%s')", l:ft)
augroup END
endfor
augroup vim_lsp_suggest
diff --git a/test/lsp_settings.vimspec b/test/lsp_settings.vimspec
index 529187e..4af6de6 100644
--- a/test/lsp_settings.vimspec
+++ b/test/lsp_settings.vimspec
@@ -83,4 +83,16 @@ Describe lsp_settings
endtry
End
End
+
+ Describe lsp_settings#exec_path
+ It should setup commands and autocmds.
+ call lsp_settings#init()
+ autocmd vim_lsp_suggest_python
+ Assert exists(':LspInstallServer')
+ delcommand LspInstallServer
+ for v in map(filter(split(execute('autocmd'), '\n'), 'v:val=~"^vim_lsp_"'), 'split(v:val, " ")[0]')
+ exe 'autocmd!' v
+ endfor
+ End
+ End
End