autoload/lsp/diag.vim | 16 ++++++++-------- autoload/lsp/options.vim | 26 ++++++++------------------ doc/lsp.txt | 37 ++++++++++++++++--------------------- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 18c247b36bc8cabc7d619b7fd8b76ba99a44ee52..5b20f4f3967de17dbd89f7028aa7707fbed57a89 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -13,26 +13,26 @@ # Signs used for LSP diagnostics sign_define([ { name: 'LspDiagError', - text: opt.lspOptions.diagSignOpts.error.text, - texthl: opt.lspOptions.diagSignOpts.error.texthl, + text: opt.lspOptions.diagSignErrorText, + texthl: opt.lspOptions.diagSignErrorTexthl, linehl: lineHL }, { name: 'LspDiagWarning', - text: opt.lspOptions.diagSignOpts.warning.text, - texthl: opt.lspOptions.diagSignOpts.warning.texthl, + text: opt.lspOptions.diagSignWarningText, + texthl: opt.lspOptions.diagSignWarningTexthl, linehl: lineHL }, { name: 'LspDiagInfo', - text: opt.lspOptions.diagSignOpts.info.text, - texthl: opt.lspOptions.diagSignOpts.info.texthl, + text: opt.lspOptions.diagSignInfoText, + texthl: opt.lspOptions.diagSignInfoTexthl, linehl: lineHL }, { name: 'LspDiagHint', - text: opt.lspOptions.diagSignOpts.hint.text, - texthl: opt.lspOptions.diagSignOpts.hint.texthl, + text: opt.lspOptions.diagSignHintText, + texthl: opt.lspOptions.diagSignHintTexthl, linehl: lineHL } ]) diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index f8e648e9fe3d638b68b10950633a7d9085a92d0f..d99f759a8cff0763a64b5efb9a1000e0d65148cf 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -54,24 +54,14 @@ # icase | fuzzy | case match for language servers that replies with a full # list of completion items completionMatcher: 'case', # diagnostics signs options - diagSignOpts: { - error: { - text: 'E>', - texthl: 'ErrorMsg', - }, - warning: { - text: 'W>', - texthl: 'Search', - }, - info: { - text: 'I>', - texthl: 'Pmenu', - }, - hint: { - text: 'H>', - texthl: 'Question', - }, - }, + diagSignErrorText: 'E>', + diagSignErrorTexthl: 'ErrorMsg', + diagSignWarningText: 'W>', + diagSignWarningTexthl: 'Search', + diagSignInfoText: 'I>', + diagSignInfoTexthl: 'Pmenu', + diagSignHintText: 'H>', + diagSignHintTexthl: 'Question', } # set the LSP plugin options from the user provided option values diff --git a/doc/lsp.txt b/doc/lsp.txt index 10e353da9291d5d2ac9c93a67f84fe5523e811d9..92ebf3e69da64ffc015e314ca6c2ccf7ccb67595 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -351,27 +351,22 @@ usePopupInCodeAction |Boolean| option. When using the |:LspCodeAction| command to display the code action for the current line, use a popup menu instead of echoing. By default this is set to false. -diagSignOpts |dict| option. Options that allow you to change diagnostic - sings text and highlight - default settings - diagSignOpts: { - error: { - text: 'E>', - texthl: 'ErrorMsg', - }, - warning: { - text: 'W>', - texthl: 'Search', - }, - info: { - text: 'I>', - texthl: 'Pmenu', - }, - hint: { - text: 'H>', - texthl: 'Question', - }, - }, +diagSignErrorText |String| option. Change diag sign text for errors + By default 'E>' +diagSignErrorTexthl |String| option. Change diag sign highlight for errors + By default 'ErrorMsg', +diagSignWarningText |String| option. Change diag sign text for warnings + By default 'W>', +diagSignWarningTexthl |String| option. Change diag sign highlight for warnings + By default 'Search', +diagSignInfoText |String| option. Change diag sign text for info + By default 'I>', +diagSignInfoTexthl |String| option. Change diag sign text highlight info + By default 'Pmenu', +diagSignHintText |String| option. Change diag sign text for hints + By default 'H>', +diagSignHintTexthl |String| option. Change diag sign highlight for hints + By default 'Question', For example, to disable the automatic placement of signs for the LSP