From: shane.xb.qian Date: Mon, 14 Nov 2022 04:43:53 +0000 (+0800) Subject: adding 'OptionsGet' func X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4575fbf6c9160c5438a7fe99d92b6fc94e9ac7c8;p=vim-lsp.git adding 'OptionsGet' func --- diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index 35dd4af..fd8cbaa 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -49,4 +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] +enddef + # vim: tabstop=8 shiftwidth=2 softtabstop=2 diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 4e06d0f..98fad20 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -14,6 +14,10 @@ def g:LspOptionsSet(opts: dict) options.OptionsSet(opts) enddef +def g:LspOptionsGet(key: string): any + return options.OptionsGet(key) +enddef + def g:LspAddServer(serverList: list>) lsp.AddServer(serverList) enddef