8000 GitHub - mohkale/consult-eglot: Jump to workspace symbols with eglot and consult
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mohkale/consult-eglot

Repository files navigation

consult-eglot

MELPA MELPA

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.

https://user-images.githubusercontent.com/23294780/131529081-7b6ad89a-98c8-40f2-9ef8-184856f8e9ef.png

Table of Contents

Installation

Manually

  1. Clone the repo.
  2. Add the repo path to your emacs load-path.
  3. Load it when needed.

From MELPA

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)

Usage

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.)

Narrowing

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 foo will narrow to variables (v) that match ”foo
  • M-x consult-eglot-symbols M bar will narrow to methods (M) that match ”bar

Extensions

Consult Eglot Embark

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)))

About

Jump to workspace symbols with eglot and consult

Resources

License

Stars

Watchers

Forks

Packages

No packages published
< 3D59 /div>

Contributors 6

0