feat(plugin-search): add optional fuzzy matching to findSearchMatches#138
Closed
rizgan wants to merge 1 commit into
Closed
feat(plugin-search): add optional fuzzy matching to findSearchMatches#138rizgan wants to merge 1 commit into
rizgan wants to merge 1 commit into
Conversation
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.
What
Adds an opt-in
fuzzyoption tofindSearchMatchesin@floatboat/nexus-plugin-search.Implements roadmap item #17 (Fuzzy search, P2).
When
{ fuzzy: true }is passed, each line is matched as a subsequence ofthe query and annotated with a relevance
score, so callers can rank results.Why
Exact and regex search require the query to appear contiguously. Fuzzy
matching lets users find lines by typing a loose, ordered subset of the
characters — the same interaction model as a command palette / file finder.
Design
from/tostays bounded to a single line instead of spanning the wholedocument.
(contiguous runs, word-start hits, and a leading match are rewarded; gaps
are penalized). Scoring style mirrors the existing
slash-state.tsranking.scoreis left to the caller.Scope / non-goals
behavior are unchanged.
replaceAllMatches, the CM6 search panel, and search history are untouched.Tests
Added 8 unit tests (fuzzy vs exact, out-of-order rejection, document order,
case sensitivity, literal-not-regex, empty query, score ranking, and "no
score on exact matches"). Full suite: 37/37 passing; package typecheck clean.