aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-12 10:05:09 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-12 10:05:09 +0900
commitce9a222097f52a2548c25e93113833204da0eb77 (patch)
tree096f33b163e16b961e1fab7b5380174d9250859b
parent67dd6f4a23c9f85412f12779d44df00545c82f31 (diff)
downloadvim-lsp-settings-ce9a222097f52a2548c25e93113833204da0eb77.tar.gz
vim-lsp-settings-ce9a222097f52a2548c25e93113833204da0eb77.tar.bz2
vim-lsp-settings-ce9a222097f52a2548c25e93113833204da0eb77.zip
Add hack to avoid failing tests
-rw-r--r--autoload/lsp_settings.vim5
-rw-r--r--test/lsp_settings.vimspec4
2 files changed, 8 insertions, 1 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 4057260..f012432 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -334,11 +334,14 @@ function! s:vim_lsp_suggest_plugin() abort
endfunction
function! s:vim_lsp_load_or_suggest_delay(ft) abort
+ if get(g:, 'vim_lsp_settings_filetype_no_delays', 0)
+ return s:vim_lsp_load_or_suggest(a:ft)
+ endif
call timer_start(0, {timer -> s:vim_lsp_load_or_suggest(a:ft)})
endfunction
function! s:vim_lsp_load_or_suggest(ft) abort
- if &filetype !=# a:ft || !has_key(s:settings, a:ft)
+ if (a:ft != '_' && &filetype !=# a:ft) || !has_key(s:settings, a:ft)
return
endif
diff --git a/test/lsp_settings.vimspec b/test/lsp_settings.vimspec
index 36db445..904610a 100644
--- a/test/lsp_settings.vimspec
+++ b/test/lsp_settings.vimspec
@@ -88,6 +88,7 @@ Describe lsp_settings
It should setup commands and autocmds.
call lsp_settings#clear()
call lsp_settings#init()
+ let g:vim_lsp_settings_filetype_no_delays = 1
autocmd vim_lsp_suggest_python
Assert exists(':LspInstallServer')
delcommand LspInstallServer
@@ -99,6 +100,7 @@ Describe lsp_settings
exe 'augroup! ' . v
endfor
bw!
+ unlet g:vim_lsp_settings_filetype_no_delays
End
It should setup commands and autocmds with python.
@@ -106,6 +108,7 @@ Describe lsp_settings
call lsp_settings#init()
new
let g:lsp_settings = {'pyls': {'cmd': ['foo', 'bar']}}
+ let g:vim_lsp_settings_filetype_no_delays = 1
Throw /E117/ :setfiletype python
bw!
for v in filter(split(execute('augroup'), '\s\+'), 'v:val=~"^vim_lsp_suggest"')
@@ -115,6 +118,7 @@ Describe lsp_settings
exe 'augroup! ' . v
endfor
unlet g:lsp_settings
+ unlet g:vim_lsp_settings_filetype_no_delays
End
End
End