Skip to content

Optionally read symbol prompts via completing-read#4117

Open
bbatsov wants to merge 1 commit into
masterfrom
prototype-symbol-completing-read
Open

Optionally read symbol prompts via completing-read#4117
bbatsov wants to merge 1 commit into
masterfrom
prototype-symbol-completing-read

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 18, 2026

Copy link
Copy Markdown
Member

CIDER's symbol prompts (cider-doc, cider-find-var, and friends when there's no symbol at point) read through cider-read-from-minibuffer, which uses completion-at-point rather than completing-read. So completing-read UIs like Vertico, Ivy and Helm don't apply there, and you get the old TAB/*Completions* behavior instead of your usual narrowing UI. We couldn't switch to completing-read in the past because it wants the whole candidate list up front and we can't dump every symbol.

A dynamic collection gets us there: cider-completing-read-symbol reads via completing-read over a table that queries the complete op lazily per input, caches per input, annotates candidates with their type/namespace, and only starts querying once the input reaches cider-completion-symbol-prompt-min-length chars (2), so an empty prompt never asks the runtime for every symbol.

It's gated behind cider-use-completing-read-for-symbol, off by default for now. Verified against a live REPL (lazy querying, the min-length guard, namespaced candidates, annotations, per-input caching) and covered by tests. Docs are in the code-completion page, including a note on eldoc-in-the-prompt behavior.


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality)

Symbol prompts (cider-doc, cider-find-var, ...) read through
cider-read-from-minibuffer, which uses completion-at-point rather than
completing-read, so completing-read UIs (Vertico, Ivy, Helm) don't apply
there. Historically we couldn't switch to completing-read because it
wants the full candidate collection up front and we can't dump every
symbol.

A dynamic collection sidesteps that: cider-completing-read-symbol reads
via completing-read over a table that queries the complete op lazily per
input, caches per input, annotates candidates with type/ns, and only
starts querying past cider-completion-symbol-prompt-min-length chars so
an empty prompt never asks for every symbol.

Gated behind cider-use-completing-read-for-symbol (off by default) while
the behavior settles.
@bbatsov
bbatsov force-pushed the prototype-symbol-completing-read branch from c6104c3 to c1465db Compare July 18, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant