feat(fuzzy-finder): migrate from go-fuzzyfinder to fzf library#511
feat(fuzzy-finder): migrate from go-fuzzyfinder to fzf library#511
Conversation
Replace go-fuzzyfinder with junegunn/fzf as the fuzzy finder backend. fzf provides better UX with partial-screen rendering, bordered UI, and context-aware headers showing what type of completion is active. Key changes: - Replace go-fuzzyfinder with fzf library (string-based selection via Printer callback instead of index-based) - Add --height=~20, --border=rounded, --info=inline-right for better UX - Add context-aware --header (Databases, Tables, System Variables, etc.) - Remove unnecessary goroutine for buffered channel fill - Remove CLI_ENABLE_FUZZY_FINDER variable; use empty CLI_FUZZY_FINDER_KEY to disable instead - Add statementNameInsertMap for display-to-insert text lookup - Update README with fuzzy finder feature and system variable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @apstndb, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the fuzzy finder functionality by replacing the underlying Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (8c65601) | #511 (58532ff) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 68.5% | 68.3% | -0.2% |
| Files | 55 | 55 | 0 |
| Lines | 5879 | 5912 | +33 |
+ | Covered | 4031 | 4043 | +12 |
- | Code to Test Ratio | 1:1.2 | 1:1.2 | -0.1 |
| Code | 13514 | 13570 | +56 |
+ | Test | 16900 | 16914 | +14 |
- | Test Execution Time | 1m5s | 2m14s | +1m9s |Code coverage of files in pull request scope (66.9% → 66.0%)
Reported by octocov |
There was a problem hiding this comment.
Code Review
This pull request successfully migrates the fuzzy finder backend from go-fuzzyfinder to the junegunn/fzf library, providing a significantly improved user experience with partial-screen rendering and context-aware headers. The consolidation of configuration variables into CLI_FUZZY_FINDER_KEY simplifies the system settings. The implementation correctly leverages the fzf library's modern API. I have identified one high-severity issue regarding the buffer deletion logic that could lead to accidental data loss when triggering the fuzzy finder in the middle of a multiline buffer or when multiple statements are present.
Summary
Migrate the fuzzy finder backend from
go-fuzzyfindertojunegunn/fzflibrary for better UX: partial-screen inline rendering, visual borders, and context-aware headers.Also consolidate
CLI_ENABLE_FUZZY_FINDER+CLI_FUZZY_FINDER_KEYinto justCLI_FUZZY_FINDER_KEY— set to empty string to disable.Key Changes
ktr0731/go-fuzzyfinderwithjunegunn/fzfrunFzf()using fzf'sParseOptions/Run/PrinterAPI (string-based selection instead of index-based). Added--height=~20(partial-screen),--border=rounded,--info=inline-right, and context-aware--header. AddedstatementNameInsertMapfor display-to-insert text lookup. No-arg statements get auto-appended;for immediate submit.EnableFuzzyFinderbool check withFuzzyFinderKey != ""EnableFuzzyFinderfield; emptyFuzzyFinderKeymeans disabledCLI_ENABLE_FUZZY_FINDERregistration; update descriptionTestStatementNameInsertTextEnableFuzzyFinderfrom all test fixturesCLI_FUZZY_FINDER_KEYin system variables tableFuture Directions
--tmuxpopup: fzf natively supports--tmuxfor rendering in a tmux popup. Could be exposed via a system variable.--multicould enable batch operations (e.g., selecting multiple tables).--previewcould show table schemas, variable descriptions, or statement help alongside candidates.--bindcould enable richer in-finder interactions.Test Plan
make checkpasses🤖 Generated with Claude Code