Enhancement: #218 Fuzzy search for QuickOpen - #1307
Merged
Merged
Conversation
Every search result gets a score based on how many queryTokes are found in the file url, the proximity Score, the modifying date and the Levenshtein-Distance.
Fixed the levenshteinDistance function;
Signed-off-by: Tom Ludwig <83090745+activcoding@users.noreply.github.com> # Conflicts: # CodeEdit/Features/QuickOpen/ViewModels/QuickOpenViewModel.swift
Conflicts: CodeEdit/Features/QuickOpen/ViewModels/QuickOpenViewModel.swift
Resolved the bug, where random files weren't displayed; Spelling mistake corrected;
The problem was the the `calculateDateScore` function, returned a score of 0.0 for files that were never created or modified by the user(downloaded files for example). The date score got multiplied with the file score, and something times 0.0 equals 0 and consequently the items weren't displayed in the list🤦🏻♂️. I simply added `score + 0.01` which assigns a default score of 0.01 to each date score. However, there is a disadvantage: the search results are worse...
…uzzySearch Signed-off-by: Tom Ludwig <83090745+activcoding@users.noreply.github.com> # Conflicts: # CodeEdit.xcodeproj/project.pbxproj
…/CodeEdit into FuzzySearch"" This reverts commit a2108db. Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Wouter01
marked this pull request as ready for review
June 10, 2023 19:22
Wouter01
requested review from
austincondiff,
matthijseikelenboom and
thecoolwinter
June 10, 2023 19:22
austincondiff
approved these changes
Jun 11, 2023
austincondiff
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Great work @activcoding. I love how well it is documented!
9 tasks done
bombardier200
approved these changes
Jun 11, 2023
bombardier200
left a comment
Contributor
There was a problem hiding this comment.
I love the documentation! Will really help out in the feature! Great Work!
matthijseikelenboom
approved these changes
Jun 11, 2023
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.
Description
This PR adds a new file, "FuzzySearch.swift", to the project. The file provides fuzzy search functionality for searching an array of URLs based on a query string. Also modified "QuickOpenViewModel.swift" to integrate the fuzzy search feature using the new 'search' function.
Note: Based on PR #1275 by @activcoding. This new PR has been opened to fix the Xcode project issues from the previous PR. See the old PR for more details.
Related Issues
Checklist