fix(tui): sort directory completions first for quoted values - #1649
Closed
yuzhiyang1 wants to merge 2 commits into
Closed
fix(tui): sort directory completions first for quoted values#1649yuzhiyang1 wants to merge 2 commits into
yuzhiyang1 wants to merge 2 commits into
Conversation
|
Hi @yuzhiyang1, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/PrimeIntellect-ai/prime-agent/blob/main/CONTRIBUTING.md for more details. |
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.
The path-completion sort in
packages/tui/src/autocomplete.tsdecided "is a directory" viasuggestion.value.endsWith("/"). When the completion value is quoted (paths with spaces, or@"..."prefixes),buildCompletionValuereturns e.g.@"dir/"— which ends with", not/— soaIsDirwas always false and the directory-first ordering silently did nothing for quoted completions.Sort on
labelinstead (which isname + "/"for directories), matching how the rest of the file treats labels.Note
Fix directory completion sorting for quoted values and edit-diff occurrence counting
countOccurrencesin edit-diff.ts to count literal occurrences and return 0 for emptyoldText, instead of counting splits.applyEditsToNormalizedContentto count occurrences in the same normalization space as the successful match: exact matches stay unique even if fuzzy normalization would create extra occurrences; fuzzy matches enforce uniqueness in the normalized space.countOccurrencesno longer uses fuzzy normalization when counting; callers relying on normalized counting behavior will get literal counts instead.Macroscope summarized 60e4a1e.