File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed
Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -79,18 +79,14 @@ endfunction
7979
8080function ! s: get_filetype_default (ft ) abort
8181 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
82+ if type (l: default ) == # v: t_list && len (l: default ) == 1 && type (l: default [0 ]) == v: t_func
83+ let l: V = l: default [0 ]
84+ try
85+ let l: default = l: V ()
86+ let g: [' lsp_settings_filetype_' . a: ft ] = l: default
87+ catch
88+ let l: default = ' '
89+ endtry
9490 endif
9591 return l: default
9692endfunction
Original file line number Diff line number Diff line change @@ -161,6 +161,17 @@ g:lsp_settings_deny_local_keys
161161 This variable is specified name of settings like 'cmd' to drop items in the
162162 settings.
163163
164+ *g:lsp_settings_filetype_xxx*
165+ g:lsp_settings_filetype_xxx
166+ xxx is a filetype name like typescript with: >
167+ g:lsp_settings_filetype_typescript
168+ <
169+ This variable can specify default language server. If the variable is a
170+ | string | , vim-lsp-settings load the langage server name. If the variable is
171+ a | list | , all of the language server names are loaded. If the variable have
172+ one element and type of the element is | function | , vim-lsp-settings call it
173+ and the result is evaluated lazy.
174+
164175:LspSettingsLocalEdit [root] *:LspSettingsLocalEdit*
165176 Edit local settings. Accepts an optional explicit [root] directory that
166177 contains the .vim-lsp-settings config directory.
You can’t perform that action at this time.
0 commit comments