feat(lua): inline input completers with a bundled @-files source - #886
Open
Firaenix wants to merge 1 commit into
Open
feat(lua): inline input completers with a bundled @-files source#886Firaenix wants to merge 1 commit into
Firaenix wants to merge 1 commit into
Conversation
Plugins can now register inline completion sources for the prompt input:
maki.api.register_input_completer({
trigger = "#",
name = "github-prs",
handler = function(query)
return { { label = "tontinton#123 fix the thing", insert = "https://..." } }
end,
})
Typing the trigger at a word boundary opens a popup above the input that
is re-queried on every keystroke. Up/Down navigate, Tab/Enter replace the
trigger and query with the selected item's insert text, and Esc keeps the
literal text. Handlers run on the plugin thread and answer over a
channel, so a slow source never blocks typing; a handler error simply
closes the popup.
A bundled file_mention plugin binds `@` to project file paths
(gitignore-aware, most recently modified first).
Also adds maki.ui.insert_input(text) so plugins can put text into the
prompt without submitting it.
Firaenix
force-pushed
the
pr/input-completers
branch
from
August 27, 2026 13:41
678eb04 to
007cd6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent of the other open PRs; based directly on main.
Typing a registered trigger char at a word boundary in the prompt opens a completion popup fed by a Lua handler:
The handler is re-queried on every keystroke and answers over a channel, so a slow source (a CLI call, an HTTP API) never blocks typing; the popup shows
searching…until the first reply,no matcheson an empty one, and closes on a handler error. Up/Down navigate, Tab/Enter replace the trigger and query with the selected item's insert text (defaulting to its label), Esc dismisses and keeps the literal text until the trigger context changes. Stale replies are discarded by generation, and/reloadclears a plugin's completers.A bundled
file_mentionplugin binds@to project file paths (gitignore-aware, most recently modified first), so@ma<Tab>insertssrc/main.rsout of the box.Also adds
maki.ui.insert_input(text), letting plugins put text into the prompt at the cursor without submitting it.Covered by handler round-trip and registration tests on the Lua side, popup unit tests (trigger detection, re-query, accept, dismiss, failure), and app-level tests for accept-into-input and plain submit.