- Notifications
You must be signed in to change notification settings - Fork371
Comments
Adds multi-token file search, and prioritizes file name matches over full path matches#3582
Merged
elliette merged 3 commits intoflutter:masterfromJan 24, 2022
Merged
Conversation
kenzieschmoll approved these changesJan 24, 2022
| if (isEmpty) return AutoCompleteMatch(script.uri); | ||
| final fileName = _fileName(script.uri); | ||
| final fileNameIdx = script.uri.lastIndexOf(fileName); |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: rename tofileNameIndex. When I first read this, I thought it wasfileNameId with a typo
| _findFuzzySegments(script.uri, query.replaceAll(' ', '')); | ||
| } else { | ||
| final fileName = _fileName(script.uri); | ||
| final fileNameIdx = script.uri.lastIndexOf(fileName); |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: same naming comment as above
| final start = file.indexOf(token); | ||
| final end = start + token.length; | ||
| autoCompleteResultSegments.add(Range(start, end)); | ||
| matchedSegments.addAll(autoCompleteResultSegments); |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
instead of creating theautoCompleteResultSegments variable, you can just add the Range tomatchedSegments directly:
matchedSegments.addd(Range(start, end));
kenzieschmoll approved these changesJan 24, 2022
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 freeto 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.
Work towards#3554
This PR makes two changes to the existing file search:
"devtools_app file search""debugger",devtools/debugger.dartis shown beforedebugger/file_search.dart