Skip to content

Commit 6a5ed5e

Browse files
committed
Also highlight preferred code actions
1 parent 9a08059 commit 6a5ed5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lsp-ui-sideline.el

+7-1
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ Push sideline overlays on `lsp-ui-sideline--ovs'."
470470
'((t :inherit lsp-disabled-code-action-face))
471471
"Faced used to show disabled code actions in the sideline.")
472472

473+
(defface lsp-ui-sideline-preferred-code-action-face
474+
'((t :inherit lsp-preferred-code-action-face))
475+
"Face used to show preferred code actions in the sideline.")
476+
473477
(defcustom lsp-ui-sideline-show-disabled-code-actions t
474478
"Whether disabled code actions should be shown.
475479
They cannot be executed."
@@ -501,9 +505,11 @@ They cannot be executed."
501505
(lsp-execute-code-action action))))
502506
map))
503507
(len (length title))
504-
(disabled? (lsp:code-action-disabled? action))
508+
((&CodeAction :disabled? :is-preferred?) action)
505509
(title (progn (add-face-text-property 0 len 'lsp-ui-sideline-global nil title)
506510
(add-face-text-property 0 len 'lsp-ui-sideline-code-action nil title)
511+
(when is-preferred?
512+
(add-face-text-property 0 len 'lsp-ui-sideline-preferred-code-action-face nil title))
507513
(when disabled?
508514
(add-face-text-property 0 len 'lsp-ui-sideline-disabled-code-action-face nil title)
509515
(add-text-properties 0 len `(help-echo ,(lsp:code-action-disabled-reason disabled?)) title))

0 commit comments

Comments
 (0)