]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add "LspSigActiveParameter" highlighting group
authorAndreas Louv <andreas@louv.dk>
Tue, 4 Apr 2023 21:51:31 +0000 (23:51 +0200)
committerAndreas Louv <andreas@louv.dk>
Tue, 4 Apr 2023 21:56:31 +0000 (23:56 +0200)
autoload/lsp/lsp.vim
autoload/lsp/signature.vim
doc/lsp.txt

index 65accd3c25e8b5bbbc46dc3e99af9091092a070b..12f44612a2c4a735d4528013274ec8d6426e150a 100644 (file)
@@ -37,6 +37,7 @@ def LspInitOnce()
 
   diag.InitOnce()
   inlayhints.InitOnce()
+  signature.InitOnce()
 
   :set ballooneval balloonevalterm
   lspInitializedOnce = true
index 945e7afd7e7c6bfbee35cda6204d5e3b35bfaa70..1bfac2d1f3f5dd5c940baa5220ffa2171daed5f6 100644 (file)
@@ -21,6 +21,10 @@ def CloseCurBufSignaturePopup()
   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<any>)
   if !lspserver.isSignatureHelpProvider
@@ -81,7 +85,7 @@ export def SignatureHelp(lspserver: dict<any>, sighelp: any): void
     :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 @@ export def SignatureHelp(lspserver: dict<any>, sighelp: any): void
 
     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
index 5a89c34bf6b9c7687b16a9f5ded1e3547e2b2760..f0c73d7966a554ddb516ce09d2c16e9aaed045a5 100644 (file)
@@ -1092,6 +1092,9 @@ override them.
 *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: >