fuzzy matching rewrite using new function get_matching_blocks() #827
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.
Replaces #824.
I wasn't planning to, but I reimplemented this for the v6 branch instead, with the major difference that it uses a new method
get_matching_blocks()
which only exists in this branch (because it doesn't behave exactly the same in some cases).Was finally able to replace those last 30 lines of code to now to a much more sensible solution thanks to
get_matching_blocks()
, and also removed the condition #824 reintroduced.The character weighting is much smaller, and the new code doesn't bump up everything to 100% like the old one did with very short queries.
The highlighter and matcher uses the same implementation now (even the same function call, since it's memoized). Before this, the highligher used a completely different implementation and sometimes would display misleading results.
Might need some need tuning still, but I'm happy with the results, because getting the matchmaking blocks means we can understand it better and score it better, with less code duplication.