From: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com> Date: Fri, 31 Mar 2023 01:18:48 +0000 (-0700) Subject: Merge pull request #190 from greeschenko/main X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d9afe8c336b7c35842b2f5fe74f437f12aca9076;p=vim-lsp.git Merge pull request #190 from greeschenko/main add diagnostics signs options --- d9afe8c336b7c35842b2f5fe74f437f12aca9076 diff --cc autoload/lsp/diag.vim index 4661ca7,5b20f4f..2366868 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@@ -10,34 -10,33 +10,52 @@@ import './util.vim export def InitOnce() var lineHL: string = opt.lspOptions.diagLineHL # Signs used for LSP diagnostics - sign_define([{name: 'LspDiagError', text: 'E>', texthl: 'ErrorMsg', - linehl: lineHL}, - {name: 'LspDiagWarning', text: 'W>', texthl: 'Search', - linehl: lineHL}, - {name: 'LspDiagInfo', text: 'I>', texthl: 'Pmenu', - linehl: lineHL}, - {name: 'LspDiagHint', text: 'H>', texthl: 'Question', - linehl: lineHL}]) + sign_define([ + { + name: 'LspDiagError', + text: opt.lspOptions.diagSignErrorText, + texthl: opt.lspOptions.diagSignErrorTexthl, + linehl: lineHL + }, + { + name: 'LspDiagWarning', + text: opt.lspOptions.diagSignWarningText, + texthl: opt.lspOptions.diagSignWarningTexthl, + linehl: lineHL + }, + { + name: 'LspDiagInfo', + text: opt.lspOptions.diagSignInfoText, + texthl: opt.lspOptions.diagSignInfoTexthl, + linehl: lineHL + }, + { + name: 'LspDiagHint', + text: opt.lspOptions.diagSignHintText, + texthl: opt.lspOptions.diagSignHintTexthl, + linehl: lineHL + } + ]) + if opt.lspOptions.highlightDiagInline + if !hlexists('LspDiagInlineError') + hlset([{name: 'LspDiagInlineError', linksto: opt.lspOptions.diagInlineErrorHL}]) + endif + if !hlexists('LspDiagInlineWarning') + hlset([{name: 'LspDiagInlineWarning', linksto: opt.lspOptions.diagInlineWarningHL}]) + endif + if !hlexists('LspDiagInlineInfo') + hlset([{name: 'LspDiagInlineInfo', linksto: opt.lspOptions.diagInlineInfoHL}]) + endif + if !hlexists('LspDiagInlineHint') + hlset([{name: 'LspDiagInlineHint', linksto: opt.lspOptions.diagInlineHintHL}]) + endif + prop_type_add('LspDiagInlineError', { highlight: 'LspDiagInlineError', override: true }) + prop_type_add('LspDiagInlineWarning', { highlight: 'LspDiagInlineWarning', override: true }) + prop_type_add('LspDiagInlineInfo', { highlight: 'LspDiagInlineInfo', override: true }) + prop_type_add('LspDiagInlineHint', { highlight: 'LspDiagInlineHint', override: true }) + endif + if opt.lspOptions.showDiagWithVirtualText if !hlexists('LspDiagVirtualText') hlset([{name: 'LspDiagVirtualText', diff --cc doc/lsp.txt index 09b19f6,2b6858a..433df4f --- a/doc/lsp.txt +++ b/doc/lsp.txt @@@ -351,17 -367,8 +367,18 @@@ usePopupInCodeAction |Boolean| optio command to display the code action for the current line, use a popup menu instead of echoing. By default this is set to false. +highlightDiagInline |Boolean| option. Highlight the diagnostics inline + By default this is set to false. +diagInlineErrorHL |String| option. The highlight group used for + inline error highlight. By default uses "SpellBad" +diagInlineWarningHL |String| option. The highlight group used for + inline warning highlight. By default uses "SpellCap" +diagInlineInfoHL |String| option. The highlight group used for + inline info highlight. By default uses "SpellRare" +diagInlineHintHL |String| option. The highlight group used for + inline hint highlight. By default uses "SpellLocal" + For example, to disable the automatic placement of signs for the LSP diagnostic messages, you can add the following line to your .vimrc file: >