diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-02-14 02:34:57 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-02-14 02:34:57 +0900 |
commit | d61017eeb5241f889249c33f40c80d7fe268cba0 (patch) | |
tree | 27a495a6cc225fac622e09da75eb3cb0c9a27bc1 /autoload | |
parent | 914b9bbdca4bbe0266b796b844f6960b3d34607b (diff) | |
download | vim-lsp-settings-d61017eeb5241f889249c33f40c80d7fe268cba0.tar.gz vim-lsp-settings-d61017eeb5241f889249c33f40c80d7fe268cba0.tar.bz2 vim-lsp-settings-d61017eeb5241f889249c33f40c80d7fe268cba0.zip |
Add server configs
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/lsp_settings.vim | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 9c83760..7fee88f 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -87,6 +87,17 @@ function! s:vim_lsp_installer(ft, ...) abort return [] endfunction +function! lsp_settings#server_config(name) abort + for l:ft in sort(keys(s:settings)) + for l:conf in s:settings[l:ft] + if l:conf.command ==# a:name && has_key(l:conf, 'config') + return l:conf['config'] + endif + endfor + endfor + return {} +endfunction + function! lsp_settings#get(name, key, default) abort let l:config = get(g:, 'lsp_settings', {}) if !has_key(l:config, a:name) @@ -349,10 +360,10 @@ function! s:vim_lsp_load_or_suggest(ft) abort if get(g:, 'lsp_loaded', 0) for l:server in s:settings[a:ft] - let l:refresh_pattern = get(l:server, 'refresh_pattern', '') + let l:config = lsp_settings#server_config(l:server.command) + let l:refresh_pattern = get(l:config, 'refresh_pattern', '') if !empty(l:refresh_pattern) let b:asyncomplete_refresh_pattern = l:refresh_pattern - let b:vim_lsp_refresh_pattern = l:refresh_pattern endif endfor endif |