snippetSupport: false
}
-# set LSP options from user provided options
+# set the LSP plugin options from the user provided option values
export def OptionsSet(opts: dict<any>)
- for key in opts->keys()
- lspOptions[key] = opts[key]
- endfor
+ lspOptions->extend(opts)
enddef
-# get LSP options
+# return a copy of the LSP plugin options
export def OptionsGet(): dict<any>
- return lspOptions
+ return lspOptions->deepcopy()
enddef
# vim: tabstop=8 shiftwidth=2 softtabstop=2
By default this is set to false.
For example, to disable the automatic placement of signs for the LSP
-diagnostic messages, you can add the following line to your .vimrc file:
->
+diagnostic messages, you can add the following line to your .vimrc file: >
+
call LspOptionsSet({'autoHighlightDiags': v:false})
<
+The LspOptionsGet() function returns a |Dict| of all the LSP plugin options,
+To get a particular option value you can use the following: >
-And to get or check one option value via its key you can query like following:
->
echo LspOptionsGet()['autoHighlightDiags']
<
-Or if no specific key but just LspOptionsGet() then to get all options.
-
==============================================================================
5. Commands *lsp-commands*
import autoload '../autoload/lsp/options.vim'
import autoload '../autoload/lsp/lsp.vim'
+# Set LSP plugin options from 'opts'.
def g:LspOptionsSet(opts: dict<any>)
options.OptionsSet(opts)
enddef
+# Return a copy of all the LSP plugin options
def g:LspOptionsGet(): dict<any>
return options.OptionsGet()
enddef
+# Add one or more LSP servers in 'serverList'
def g:LspAddServer(serverList: list<dict<any>>)
lsp.AddServer(serverList)
enddef
+# Register 'Handler' callback function for LSP command 'cmd'.
def g:LspRegisterCmdHandler(cmd: string, Handler: func)
lsp.RegisterCmdHandler(cmd, Handler)
enddef