]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Merge pull request #190 from greeschenko/main
authorYegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
Fri, 31 Mar 2023 01:18:48 +0000 (18:18 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Mar 2023 01:18:48 +0000 (18:18 -0700)
add diagnostics signs options

1  2 
autoload/lsp/diag.vim
autoload/lsp/options.vim
doc/lsp.txt

index 4661ca75a945cae179527d5bf536b16e181f91fc,5b20f4f3967de17dbd89f7028aa7707fbed57a89..2366868d587b4df90248f5d5c9ae04130fb3dc34
@@@ -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',
Simple merge
diff --cc doc/lsp.txt
index 09b19f66c2fbd211694b7659e950417064dec63e,2b6858a8422ca7d90b17267c2a0c1f6e1bbe1825..433df4f98e76a6a58a969ad272acaeba9f653a6f
@@@ -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: >