# Remove all the existing diagnostic signs
sign_unplace('LSPDiag', {buffer: bnr})
+ if has('patch-9.0.1157') && opt.lspOptions.showDiagWithVirtualText
+ # Remove all virtual text
+ prop_remove({type: 'LspDiagVirtualText', bufnr: bnr, all: true})
+ endif
+
if !lspserver.diagsMap->has_key(bnr) ||
lspserver.diagsMap[bnr].sortedDiagnostics->empty()
return
signs->add({id: 0, buffer: bnr, group: 'LSPDiag',
lnum: lnum,
name: DiagSevToSignName(diag.severity)})
+
+ if has('patch-9.0.1157') && opt.lspOptions.showDiagWithVirtualText
+ prop_add( lnum, 0, {
+ 'bufnr': bnr,
+ 'type': 'LspDiagVirtualText',
+ 'text': '┌─ ' .. diag.message,
+ 'text_align': 'above',
+ 'text_padding_left': diag.range.start.character})
+ endif
endfor
signs->sign_placelist()
prop_type_add('LspReadRef', {highlight: 'DiffChange', override: true})
prop_type_add('LspWriteRef', {highlight: 'DiffDelete', override: true})
+ if has('patch-9.0.1157') && opt.lspOptions.showDiagWithVirtualText
+ if !hlexists('LspDiagVirtualText')
+ hlset([{name: 'LspDiagVirtualText', linksto: 'LineNr'}])
+ endif
+ prop_type_add('LspDiagVirtualText', {highlight: 'LspDiagVirtualText', override: true})
+ endif
+
inlayhints.InitOnce()
:set ballooneval balloonevalterm
showDiagInPopup: true,
# Default diagnostic highlight on lines
diagLineHL: 'DiffAdd',
+ # Show a diagnostic messages with virtual text
+ showDiagWithVirtualText: false,
# Don't print message when a configured language server is missing.
ignoreMissingServer: false,
# Use a floating menu to show the code action menu instead of asking for input
server. By default this is set to false. The inlay
hint text is displayed as a virtual text. Needs Vim
version 9.0.0178 or later.
+showDiagWithVirtualText |Boolean| option. Show diagnostic messages text from the language
+ server with virtual text. By default this is set to false.
+ Needs Vim version 9.0.1157 or later.
showSignature |Boolean| option. In insert mode, automatically show
the current symbol signature in a popup.
By default this is set to true.