diff --git a/init.el b/init.el index 5d7d235..ffac10e 100755 --- a/init.el +++ b/init.el @@ -348,3 +348,19 @@ (lambda (&optional count file) (hyprctl "hy3:movefocus" "u"))) (advice-add #'evil-window-down :override (lambda (&optional count file) (hyprctl "hy3:movefocus" "d"))) + +;;; Overrides + +;; stop lsp-mode from yoloing code actions when only one is present +(defun lsp--select-action (actions) + "Select an action to execute from ACTIONS." + (cond + ((seq-empty-p actions) (signal 'lsp-no-code-actions nil)) + ;;((and (eq (seq-length actions) 1) lsp-auto-execute-action) + ;;(lsp-seq-first actions)) + (t (let ((completion-ignore-case t)) + (lsp--completing-read "Select code action: " + (seq-into actions 'list) + (-compose (lsp--create-unique-string-fn) + #'lsp:code-action-title) + nil t)))))