@@ -77,6 +77,24 @@ function! lsp_settings#executable(cmd) abort
7777 return 0
7878endfunction
7979
80+ function ! s: get_filetype_default (ft ) abort
81+ let l: default = get (g: , ' lsp_settings_filetype_' . a: ft , ' ' )
82+ if type (l: default ) == # v: t_list
83+ for l: i in range (len (l: default ))
84+ let l: V = l: default [l: i ]
85+ if type (l: V ) == # v: t_func
86+ try
87+ let l: default [l: i ] = l: V ()
88+ catch
89+ let l: default [l: i ] = ' '
90+ endtry
91+ endif
92+ endfor
93+ let g: [' lsp_settings_filetype_' . a: ft ] = l: default
94+ endif
95+ return l: default
96+ endfunction
97+
8098function ! s: vim_lsp_installer (ft , ... ) abort
8199 let l: ft = tolower (get (split (a: ft , ' \.' ), 0 , ' ' ))
82100 let l: ft = empty (l: ft ) ? ' _' : l: ft
@@ -91,7 +109,7 @@ function! s:vim_lsp_installer(ft, ...) abort
91109 let l: servers += s: settings [' _' ]
92110 endif
93111
94- let l: default = get ( g: , ' lsp_settings_filetype_ ' . a: ft, ' ' )
112+ let l: default = s: get_filetype_default ( a: ft )
95113
96114 let l: name = get (a: 000 , 0 , ' ' )
97115 for l: conf in l: servers
@@ -519,7 +537,7 @@ function! s:vim_lsp_load_or_suggest(ft) abort
519537 command ! -nargs =1 LspRegisterServer autocmd User lsp_setup call lsp_settings#register_server (<args> )
520538 endif
521539
522- let l: default = get ( g: , ' lsp_settings_filetype_ ' . a: ft, ' ' )
540+ let l: default = s: get_filetype_default ( a: ft )
523541
524542 let l: found = 0
525543 let l: disabled = 0
0 commit comments