Inline @ file-mention suggestions for the TUI composer — the SAME
affordance the web composer already has, so both channels share one
behaviour instead of a modal on one side and an inline picker on the
other.
Ranking is powered by fff (internal.file-picker/fuzzy-file-rows) — the
very same engine behind the find_files tool and the gateway
/v1/sessions/:sid/suggest service — so @fpick fuzzily finds
file_picker.clj (typo-tolerant subsequence match ranked by frecency),
not just a literal substring.
The trigger rules mirror the web/JS verbatim so writing a literal @
is never endangered:
@ must begin a word (start of input or right after whitespace),
so foo@bar, user@host, decorators never pop the picker;@@ escapes to a literal @ and suppresses the popup;fff owns a FRESH in-memory index instance that is opened OFF the render
thread and cached for the session; per-keystroke search on the open
instance is sub-millisecond, so filtering stays instant. The instance is
NEVER closed while a search may run (fff's native search SIGSEGVs on a
closed handle); a periodic rebuild swaps a new instance in and closes the
superseded one only after a grace period.
Inline `@` file-mention suggestions for the TUI composer — the SAME affordance the web composer already has, so both channels share one behaviour instead of a modal on one side and an inline picker on the other. Ranking is powered by fff (`internal.file-picker/fuzzy-file-rows`) — the very same engine behind the `find_files` tool and the gateway `/v1/sessions/:sid/suggest` service — so `@fpick` fuzzily finds `file_picker.clj` (typo-tolerant subsequence match ranked by frecency), not just a literal substring. The trigger rules mirror the web/JS verbatim so writing a literal `@` is never endangered: - the `@` must begin a word (start of input or right after whitespace), so `foo@bar`, `user@host`, decorators never pop the picker; - `@@` escapes to a literal `@` and suppresses the popup; - selection is advisory — nothing is rewritten unless the user picks. fff owns a FRESH in-memory index instance that is opened OFF the render thread and cached for the session; per-keystroke `search` on the open instance is sub-millisecond, so filtering stays instant. The instance is NEVER closed while a search may run (fff's native search SIGSEGVs on a closed handle); a periodic rebuild swaps a new instance in and closes the superseded one only after a grace period.
(apply-mention {:keys [lines crow ccol] :as st} path)Splice the picked path into input-state, replacing the active @token
at the caret with a visible file mention (input/format-file-mention) plus
a trailing space. Returns the input unchanged when no mention is active.
Splice the picked `path` into `input-state`, replacing the active `@token` at the caret with a visible file mention (`input/format-file-mention`) plus a trailing space. Returns the input unchanged when no mention is active.
(mention-at head)Return {:query q :at start} for an active @ file mention ending at
the caret, or nil. head is the input text up to the caret. start is
the index of the @ within head.
Return `{:query q :at start}` for an active `@` file mention ending at
the caret, or nil. `head` is the input text up to the caret. `start` is
the index of the `@` within `head`.(suggestions input-state selected-index)File-mention suggestions for input-state, shaped to ride the SAME
overlay + key handling as slash suggestions: :slash/usage is the
path chip, :label the size · age · status meta, :slash/selected?
marks the cursor row. Returns nil when there is no active @ mention
at the caret (so the slash path stays in charge).
File-mention suggestions for `input-state`, shaped to ride the SAME overlay + key handling as slash suggestions: `:slash/usage` is the `path` chip, `:label` the size · age · status meta, `:slash/selected?` marks the cursor row. Returns nil when there is no active `@` mention at the caret (so the slash path stays in charge).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |