feat(lsp,vertico): add consult-eglot

- Load when :tools lsp +eglot and :completion vertico are on
- Bind consult-eglot-symbols to <leader> c j
This commit is contained in:
Itai Y. Efrat 2021-08-22 22:28:42 +03:00
parent 3991d2ce77
commit d2d940fdf1
4 changed files with 17 additions and 3 deletions

View file

@ -64,7 +64,9 @@
(:when (featurep! :tools lsp +eglot)
:desc "LSP Execute code action" "a" #'eglot-code-actions
:desc "LSP Rename" "r" #'eglot-rename
:desc "LSP Find declaration" "j" #'eglot-find-declaration))
:desc "LSP Find declaration" "j" #'eglot-find-declaration
(:when (featurep! :completion vertico)
:desc "Jump to symbol in current workspace" "j" #'consult-eglot-symbols)))
;;; <leader> f --- file
(:prefix-map ("f" . "file")

View file

@ -398,7 +398,9 @@
(:when (featurep! :tools lsp +eglot)
:desc "LSP Execute code action" "a" #'eglot-code-actions
:desc "LSP Rename" "r" #'eglot-rename
:desc "LSP Find declaration" "j" #'eglot-find-declaration)
:desc "LSP Find declaration" "j" #'eglot-find-declaration
(:when (featurep! :completion vertico)
:desc "Jump to symbol in current workspace" "j" #'consult-eglot-symbols))
:desc "Compile" "c" #'compile
:desc "Recompile" "C" #'recompile
:desc "Jump to definition" "d" #'+lookup/definition

View file

@ -48,3 +48,10 @@ server getting expensively restarted when reverting buffers."
(+lsp-optimization-mode -1))))
server)))
(funcall fn server))))
(use-package! consult-eglot
:defer t
:when (featurep! :completion vertico)
:init
(map! :map eglot-mode-map [remap xref-find-apropos] #'consult-eglot-symbols))

View file

@ -2,7 +2,10 @@
;;; tools/lsp/packages.el
(if (featurep! +eglot)
(progn
(package! eglot :pin "c17bdf6c98d6bf0f1a85f1175556e1038654402f")
(when (featurep! :completion vertico)
(package! consult-eglot :pin "a6aeb6fa078cc7ea6537793868f606b55ac63088")))
(package! lsp-mode :pin "82fa7743602e9a6366ecd128efcd620ecc97fcf4")
(package! lsp-ui :pin "b625f3cb5e88559ab99bec58f7a14272edb296bc")
(when (featurep! :completion ivy)