Skip to content

Commit

Permalink
Touch up signature faces (#4608)
Browse files Browse the repository at this point in the history
* Allow customization of signature function argument highlight

* Use default child frame border face
  • Loading branch information
wyuenho authored Nov 12, 2024
1 parent 1ddd70a commit e178115
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5799,7 +5799,10 @@ RENDER-ALL - nil if only the signature should be rendered."
(list :position (point)
:background-color (face-attribute 'lsp-signature-posframe :background nil t)
:foreground-color (face-attribute 'lsp-signature-posframe :foreground nil t)
:border-color (face-attribute 'font-lock-comment-face :foreground nil t))))
:border-color (face-attribute (if (facep 'child-frame-border)
'child-frame-border
'internal-border)
:background nil t))))
(posframe-hide " *lsp-signature*")))

(defun lsp--handle-signature-update (signature)
Expand Down Expand Up @@ -5857,6 +5860,11 @@ It will show up only if current point has signature help."
(list lsp-signature-doc-lines))))
(lsp-signature-activate))

(defface lsp-signature-highlight-function-argument
'((t :inherit eldoc-highlight-function-argument))
"The face to use to highlight function arguments in signatures."
:group 'lsp-mode)

(defun lsp--signature->message (signature-help)
"Generate eldoc message from SIGNATURE-HELP response."
(setq lsp--signature-last signature-help)
Expand Down Expand Up @@ -5902,7 +5910,7 @@ It will show up only if current point has signature help."
(end (if (stringp selected-param-label)
(+ start (length selected-param-label))
(cl-second selected-param-label))))
(add-face-text-property start end 'eldoc-highlight-function-argument nil label)))
(add-face-text-property start end 'lsp-signature-highlight-function-argument nil label)))
(concat prefix label method-docs))))

(defun lsp-signature ()
Expand Down

0 comments on commit e178115

Please sign in to comment.