From 4575fbf6c9160c5438a7fe99d92b6fc94e9ac7c8 Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Mon, 14 Nov 2022 12:43:53 +0800 Subject: [PATCH] adding 'OptionsGet' func --- autoload/lsp/options.vim | 5 +++++ plugin/lsp.vim | 4 ++++ 2 files changed, 9 insertions(+) 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 -- 2.48.1