# Notification: textDocument/publishDiagnostics
# Param: PublishDiagnosticsParams
export def DiagNotification(lspserver: dict<any>, uri: string, newDiags: list<dict<any>>): void
+ # Diagnostics are disabled for this server
+ if lspserver.features->has_key('diagnostics') && !lspserver.features.diagnostics
+ return
+ endif
+
var fname: string = util.LspUriToFile(uri)
var bnr: number = fname->bufnr()
if bnr == -1
}
])
<
+Another way is to disable the unwanted features: for example if you don't want
+diagnostics from the typescript-language-server, but want to use it for
+everything else: >
+
+ vim9script
+
+ g:LspAddServer([
+ {
+ filetype: ['javascript', 'typescript'],
+ path: '/usr/local/bin/typescript-language-server',
+ args: ['--stdio'],
+ features: {
+ diagnostics: false
+ }
+ },
+ ])
+<
==============================================================================
17. Language Server Features *lsp-features*
*lsp-features-definition*
definition Used by |:LspGotoDefinition|, and
|:LspPeekDefinition|
+ *lsp-features-diagnostics*
+diagnostics Used to disable diagnostics for a single
+ language server, by default diagnostics are
+ combined from all running servers, by setting
+ this to |v:false| you can ignore diagnostics
+ from a specific server.
*lsp-features-documentFormatting*
documentFormatting Used by |:LspFormat|, and 'formatexpr'
*lsp-features-documentHighlight*