File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -470,13 +470,21 @@ 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+ (defcustom lsp-ui-sideline-show-disabled-code-actions t
474+ " Whether disabled code actions should be shown.
475+ They cannot be executed."
476+ :type 'boolean
477+ :group 'lsp-ui-sideline )
478+
473479(defun lsp-ui-sideline--code-actions (actions bol eol )
474480 " Show code ACTIONS."
475481 (let ((inhibit-modification-hooks t ))
476482 (when lsp-ui-sideline-actions-kind-regex
477- (setq actions (seq-filter (-lambda ((&CodeAction :kind? ))
478- (or (not kind?)
479- (s-match lsp-ui-sideline-actions-kind-regex kind?) ))
483+ (setq actions (seq-filter (-lambda ((&CodeAction :kind? :disabled? ))
484+ (and (or (not disabled?)
485+ lsp-ui-sideline-show-disabled-code-actions)
486+ (or (not kind?)
487+ (s-match lsp-ui-sideline-actions-kind-regex kind?) )))
480488 actions)))
481489 (setq lsp-ui-sideline--code-actions actions)
482490 (lsp-ui-sideline--delete-kind 'actions )
You can’t perform that action at this time.
0 commit comments