autoload/lsp/lsp.vim | 1 + autoload/lsp/signature.vim | 8 ++++++-- doc/lsp.txt | 3 +++ diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 65accd3c25e8b5bbbc46dc3e99af9091092a070b..12f44612a2c4a735d4528013274ec8d6426e150a 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -37,6 +37,7 @@ prop_type_add('LspWriteRef', {highlight: 'DiffDelete', override: true}) diag.InitOnce() inlayhints.InitOnce() + signature.InitOnce() :set ballooneval balloonevalterm lspInitializedOnce = true diff --git a/autoload/lsp/signature.vim b/autoload/lsp/signature.vim index 945e7afd7e7c6bfbee35cda6204d5e3b35bfaa70..1bfac2d1f3f5dd5c940baa5220ffa2171daed5f6 100644 --- a/autoload/lsp/signature.vim +++ b/autoload/lsp/signature.vim @@ -21,6 +21,10 @@ CloseSignaturePopup(lspserver) enddef +export def InitOnce() + hlset([{name: 'LspSigActiveParameter', default: true, linksto: 'LineNr'}]) +enddef + # Initialize the signature triggers for the current buffer export def BufferInit(lspserver: dict) if !lspserver.isSignatureHelpProvider @@ -81,7 +85,7 @@ if opt.lspOptions.echoSignature :echon "\r\r" :echon '' :echon text->strpart(0, startcol) - :echoh LineNr + :echoh LspSigActiveParameter :echon text->strpart(startcol, hllen) :echoh None :echon text->strpart(startcol + hllen) @@ -91,7 +95,7 @@ lspserver.signaturePopup->popup_close() var popupID = text->popup_atcursor({moved: [col('.') - 1, 9999999]}) var bnum: number = popupID->winbufnr() - prop_type_add('signature', {bufnr: bnum, highlight: 'LineNr'}) + prop_type_add('signature', {bufnr: bnum, highlight: 'LspSigActiveParameter'}) if hllen > 0 prop_add(1, startcol + 1, {bufnr: bnum, length: hllen, type: 'signature'}) endif diff --git a/doc/lsp.txt b/doc/lsp.txt index 5a89c34bf6b9c7687b16a9f5ded1e3547e2b2760..f0c73d7966a554ddb516ce09d2c16e9aaed045a5 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -1092,6 +1092,9 @@ "Label" highlight group. *LspInlayHintsType* Used to highlight inlay hints of kind "type". By default, linked to the "Conceal" highlight group. +*LspSigActiveParameter* Used to highlight the active signature + parameter. By default, linked to the "LineNr" + highlight group. For example, to override the highlight used for diagnostics virtual text, you can use the following: >