From abe02e6ddf162190e570a9b7fa59e519ab668e14 Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Tue, 15 Nov 2022 14:20:22 +0800 Subject: [PATCH] return entire lsp options instead of specific one --- autoload/lsp/options.vim | 6 +++--- doc/lsp.txt | 4 +++- plugin/lsp.vim | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) 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>) -- 2.48.1