vim9script
+import lspOptions from './lspoptions.vim'
+
def s:lspDiagSevToSignName(severity: number): string
var typeMap: list<string> = ['LspDiagError', 'LspDiagWarning',
'LspDiagInfo', 'LspDiagHint']
# New LSP diagnostic messages received from the server for a file.
# Update the signs placed in the buffer for this file
export def LspDiagsUpdated(lspserver: dict<any>, bnr: number)
+ if !lspOptions.autoHighlightDiags
+ return
+ endif
+
if bnr == -1 || !lspserver.diagsMap->has_key(bnr)
return
endif
--- /dev/null
+vim9script
+
+# LSP plugin options
+# User can override these by calling the lsp#setOptions() function.
+export var lspOptions: dict<any> = {
+ # In insert mode, complete the current symbol automatically
+ # Otherwise, use omni-completion
+ autoComplete: true,
+ # In normal mode, highlight the current symbol automatically
+ autoHighlight: false,
+ # In insert mode, show the current symbol signature automatically
+ showSignature: true,
+ # In insert mode, echo the current symbol signature in the status line
+ # instead of showing it in a popup
+ echoSignature: false,
+ # Automatically highlight diagnostics messages from LSP server
+ autoHighlightDiags: true
+}
Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
For Vim version 8.2.2342 and above
-Last change: Nov 13, 2021
+Last change: Nov 14, 2021
==============================================================================
*lsp-license*
The LSP servers are added using the lsp#addServer() function. This function
accepts a list of LSP servers with the above information.
+ *lsp-options*
+Some of the LSP plugin features can be enabled or disabled by using the
+lsp#setOptions() function. This function accepts a dictionary argument with the
+following optional items:
+
+ autoComplete In insert mode, automatically complete the current
+ symbol. Otherwise use omni-completion. By default this
+ is set to true.
+ autoHighlight In normal mode, automatically highlight all the
+ occurrences of the symbol under the cursor. By default
+ this is set to false.
+ showSignature In insert mode, automatically show the current symbol
+ signature in a popup. By default this is set to true.
+ echoSignature In insert mode, echo the current symbol signature
+ instead of showing it in a popup. By default this is
+ set to false.
+ autoHighlightDiags Automatically place signs on the lines with a
+ diagnostic message from the LSP server. By default
+ this is set to true.
+
+For example, to disable the automatic placement of signs for the LSP
+diagnostic messages, you can add the following line to your .vimrc file:
+
+ call lsp#setOptions({'autoHighlightDiags': v:false})
+
==============================================================================
5. Commands *lsp-commands*