From 750721492c1af1ad29cbe89c8af23767cfcdb795 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Sun, 25 Apr 2021 17:10:07 +0300 Subject: [PATCH] selectrum: add consult-lsp - add `consult-lsp` to tools/lsp if the selectrum module is active - add the selectrum/consult version of workspace symbol search under `SPC c j/J` - update TODO.org --- modules/completion/selectrum/TODO.org | 2 ++ modules/completion/selectrum/packages.el | 2 ++ modules/config/default/+emacs-bindings.el | 4 +++- modules/config/default/+evil-bindings.el | 7 +++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/completion/selectrum/TODO.org b/modules/completion/selectrum/TODO.org index 3054bf28c..f0233f234 100644 --- a/modules/completion/selectrum/TODO.org +++ b/modules/completion/selectrum/TODO.org @@ -10,3 +10,5 @@ https://github.com/minad/marginalia/issues/59 In ivy, backspace on =/foo/bar/!= (where =!= is the cursor) leads to =/foo/!= In selectrum, it leads to =/foo/bar!= ** TODO =SPC s B= +* PROJ Other +** TODO bind =consult-lsp-diagnostics= to something? diff --git a/modules/completion/selectrum/packages.el b/modules/completion/selectrum/packages.el index 25866daa6..e22ec16ad 100644 --- a/modules/completion/selectrum/packages.el +++ b/modules/completion/selectrum/packages.el @@ -12,6 +12,8 @@ (package! consult :pin "846c715ee1df94292a9bb2467810bd7959ccf078") (when (featurep! :checkers syntax) (package! consult-flycheck :pin "846c715ee1df94292a9bb2467810bd7959ccf078")) +(when (featurep! :tools lsp) + (package! consult-lsp :pin "ed3cfd2e67fc5117819c0c739814780bb4c2d716")) (package! embark :pin "5f3097824f8c3d17bcd70c4e4ce597bcfcf2196f") (package! embark-consult :pin "5f3097824f8c3d17bcd70c4e4ce597bcfcf2196f") diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index d88ca6268..39807c336 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -54,13 +54,15 @@ (:when (featurep! :completion helm) :desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol :desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol) + (:when (featurep! :completion selectrum) + :desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols + :desc "Jump to symbol in any workspace" "J" (cmd! #'consult-lsp-symbols '(4))) (:when (featurep! :ui treemacs +lsp) :desc "Errors list" "X" #'lsp-treemacs-errors-list :desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy :desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t) :desc "References tree" "R" (cmd!! #'lsp-treemacs-references t) :desc "Symbols" "S" #'lsp-treemacs-symbols)) - (:when (featurep! :tools lsp +eglot) :desc "LSP Execute code action" "a" #'eglot-code-actions :desc "LSP Rename" "r" #'eglot-rename diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index a6b33c761..3c4e85040 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -393,14 +393,17 @@ (:when (featurep! :completion helm) :desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol :desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol) + (:when (featurep! :completion selectrum) + :desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols + :desc "Jump to symbol in any workspace" "J" (cmd! #'consult-lsp-symbols '(4))) (:when (featurep! :ui treemacs +lsp) :desc "Errors list" "X" #'lsp-treemacs-errors-list :desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy :desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t) :desc "References tree" "R" (cmd!! #'lsp-treemacs-references t) :desc "Symbols" "S" #'lsp-treemacs-symbols) - :desc "LSP" "l" #'+default/lsp-command-map - :desc "LSP Rename" "r" #'lsp-rename) + :desc "LSP" "l" #'+default/lsp-command-map + :desc "LSP Rename" "r" #'lsp-rename) (:when (featurep! :tools lsp +eglot) :desc "LSP Execute code action" "a" #'eglot-code-actions :desc "LSP Rename" "r" #'eglot-rename