A consulting-read interface for eglot.
This package acts as a parallel of consult-lsp for eglot and provides a front-end
interface for the workspace/symbols LSP procedure call.
- Clone the repo.
- Add the repo path to your emacs
load-path. - Load it when needed.
This package is on MELPA. You can add this to your package-archives variable and
then install through M-x package-install.
(push '("melpa" . "https://melpa.org/packages/") package-archives)
(package-refresh-contents)
(package-install 'consult-eglot)consult-eglot provides one interactive function: consult-eglot-symbols, that uses completing-read to filter symbols from your workspace.
By default, it shows matches across your whole project according to the LSP server’s workspace/symbol output. (Naturally, if your LSP server of choice doesn’t support that feature, consult-eglot won’t work.)
To not show any and all textual matches, narrow down the kind of symbol that is being matched using =consult=’s narrowing feature. Start your completing-read minibuffer prompt with one of the consult-narrow-key symbols as defined in the consult-eglot-narrow alist.
To explore these during completing-read, it’s a good idea to execute M-x consult-narrow-help during completing-read, or create a key binding for easy access.
Examples:
M-x consult-eglot-symbols v foowill narrow to variables (v) that match ”foo”M-x consult-eglot-symbols M barwill narrow to methods (M) that match ”bar”
Adds support for embark exports and action overrides to consult-eglot searches.
(package-install 'consult-eglot-embark)
(with-eval-after-load 'embark
(with-eval-after-load 'consult-eglot
(require 'consult-eglot-embark)
(consult-eglot-embark-mode)))