From: shane.xb.qian Date: Tue, 15 Nov 2022 06:20:22 +0000 (+0800) Subject: return entire lsp options instead of specific one X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=abe02e6ddf162190e570a9b7fa59e519ab668e14;p=vim-lsp.git return entire lsp options instead of specific one --- diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index fd8cbaa..f1605f7 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -49,9 +49,9 @@ export def OptionsSet(opts: dict) endfor enddef -# get LSP option value per user provided key -export def OptionsGet(key: string): any - return lspOptions[key] +# get LSP options +export def OptionsGet(): dict + return lspOptions enddef # vim: tabstop=8 shiftwidth=2 softtabstop=2 diff --git a/doc/lsp.txt b/doc/lsp.txt index 923edbb..b7d6e86 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -285,8 +285,10 @@ diagnostic messages, you can add the following line to your .vimrc file: And to get or check one option value via its key you can query like following: > - echo LspOptionsGet('autoHighlightDiags') + echo LspOptionsGet()['autoHighlightDiags'] < +Or if no specific key but just LspOptionsGet() then to get all options. + ============================================================================== 5. Commands *lsp-commands* diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 98fad20..163b529 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -14,8 +14,8 @@ def g:LspOptionsSet(opts: dict) options.OptionsSet(opts) enddef -def g:LspOptionsGet(key: string): any - return options.OptionsGet(key) +def g:LspOptionsGet(): dict + return options.OptionsGet() enddef def g:LspAddServer(serverList: list>)