Skip to content

Conversation

sarub0b0
Copy link
Owner

Summary

This PR migrates the fuzzy matching implementation from fuzzy-matcher to nucleo-matcher as suggested in #781.

Changes

Library Migration

  • Replaced: fuzzy-matchernucleo-matcher
  • Performance: 6-10x faster matching (beneficial for larger datasets)
  • Maintenance: nucleo-matcher is actively maintained and used in Helix editor

Comprehensive Test Coverage

  • Added 14 new test cases for fuzzy matching behavior
  • Tests increased: 491 → 505 total
  • Backward compatibility verified: All tests pass with both fuzzy-matcher and nucleo-matcher

Test Coverage Includes

  • Basic matching (partial match, exact match, no match)
  • Fuzzy matching (sequential and non-sequential character matching)
  • Case insensitivity
  • Kubernetes resource name patterns (hyphens, numbers, namespaces)
  • Edge cases (empty lists, single items)
  • Score-based ordering
  • ANSI escape sequence handling

Technical Details

  • Replaced fuzzy-matcher::SkimMatcherV2 with nucleo-matcher::Matcher
  • Updated matching logic to use Pattern::parse() and score()
  • Changed score type from i64 to u32
  • Used sort_by_key with Reverse for cleaner sorting

Testing

All 505 tests pass, including:

  • ✅ Existing tests continue to work
  • ✅ New fuzzy matching tests added
  • ✅ Verified compatibility with both implementations

Performance Impact

Current use case (~67 resources) shows no noticeable performance difference, but this change future-proofs for:

  • Larger Kubernetes clusters
  • More complex filtering scenarios
  • Better Unicode text handling

Related Issue

Related to #781

🤖 Generated with Claude Code

Replace fuzzy-matcher with nucleo-matcher for improved performance
and better Unicode handling. While the current use case (filtering
Kubernetes resources with RFC1123 names) doesn't show noticeable
performance difference with ~67 resources, this change provides:

- 6-10x faster matching for larger datasets
- Better maintained library (used in Helix editor)
- Future-proofing for growth

Additionally, added comprehensive test suite for fuzzy matching:
- Added 14 new test cases covering edge cases, Kubernetes resource
  name patterns, case sensitivity, and scoring behavior
- Tests increased from 491 to 505 total
- All tests pass with both fuzzy-matcher and nucleo-matcher,
  ensuring backward compatibility

Technical changes:
- Replaced fuzzy-matcher::SkimMatcherV2 with nucleo-matcher::Matcher
- Updated matching logic to use Pattern::parse() and score()
- Changed score type from i64 to u32
- Used sort_by_key with Reverse for cleaner sorting code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@sarub0b0 sarub0b0 linked an issue Oct 19, 2025 that may be closed by this pull request
@sarub0b0 sarub0b0 merged commit 7d3a80e into main Oct 19, 2025
1 check passed
@sarub0b0 sarub0b0 deleted the migrate-to-nucleo-matcher-781 branch October 19, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible minor enhancement: nucleo for fuzzy matching

1 participant