0.17 phase 5 PR D: history lane reservation + path escape#145
Open
StanMarek wants to merge 2 commits into
Open
0.17 phase 5 PR D: history lane reservation + path escape#145StanMarek wants to merge 2 commits into
StanMarek wants to merge 2 commits into
Conversation
When a SpecArg context saturates max_results with normal candidates, the post-rank history fuzzy-fill flow had no room to add anything — its remaining = max_history_results.min(max_results - results.len()) clamped to zero. High-confidence (prefix/exact) history rows vanished from the popup whenever it filled up. rank_with_history now reserves up to 2 slots for prefix-matching history BEFORE ranking candidates. The cap is reduced upstream so the popup never grows past max_results. Flag and redirect contexts skip the lane entirely (flags don't prefix-match command lines; redirects want filenames).
Filesystem suggestions (FilePath/Directory kinds) are now escaped before
the byte buffer is sent to the shell. Unquoted context backslashes the
full word-splitting/expansion metacharacter set; single quotes only
need the close-reopen dance for embedded apostrophes; double quotes
escape the four-character set (", \\, $, backtick).
The escape is applied once inside accept_suggestion_locked and the
escaped replacement is returned so the chaining caller writes the SAME
text into the predicted buffer. Without that, the engine's next
context read would see the raw display text while the shell sees the
escaped form — the next completion would resolve the wrong directory.
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.
Summary
Test plan
References
Notes
feat/static-alias-parser) and PR B (feat/brew-query-aware-cask-split) touchgc-suggest/src/alias.rsandproviders/brew.rs; PR C (feat/macos-smart-completions-c) touchesengine.rsnear~1863forparams["prev_arg"]injection. PR D touchesengine.rsonly inrank_with_history(~1625-1700) andhandler.rs(accept_suggestion_locked+accept_with_chaining) — no overlap with A/B; trivial overlap with C if it lands first.provider_latencybench was not run on this host — the workspace test suite + clippy + fmt all pass; manual macOS smoke deferred to the end-of-milestone pass per the plan.