feat(interactive): add fzf-style fuzzy finder for USE statement#506
feat(interactive): add fzf-style fuzzy finder for USE statement#506
Conversation
Add an interactive fuzzy finder triggered by a configurable key binding (default: Ctrl+T) that provides completion-style selection for client-side statement arguments. MVP supports USE <database> context. - Add ktr0731/go-fuzzyfinder dependency (pure Go, tcell-based) - Upgrade go-multiline-ny v0.21.0 -> v0.22.4, go-readline-ny v1.9.1 -> v1.14.1 - Add CLI_ENABLE_FUZZY_FINDER (default: true) and CLI_FUZZY_FINDER_KEY (default: C_T) system variables for user configuration - Implement fuzzyFinderCommand with terminal handoff pattern (GotoEndLine/rewind) and completion-style argument replacement - Detect USE context, pre-fill fzf query with typed prefix, replace argument portion on selection 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 enhances the interactive command-line interface by integrating a fuzzy finder. This feature streamlines the process of selecting database names when issuing Highlights
Changelog
Activity
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 (124c9ea) | #506 (8610f06) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 70.0% | 69.4% | -0.6% |
| Files | 54 | 55 | +1 |
| Lines | 5704 | 5762 | +58 |
+ | Covered | 3997 | 4004 | +7 |
- | Code to Test Ratio | 1:1.2 | 1:1.2 | -0.1 |
| Code | 13118 | 13244 | +126 |
+ | Test | 16510 | 16622 | +112 |
- | Test Execution Time | 1m4s | 1m13s | +9s |Code coverage of files in pull request scope (82.3% → 74.6%)
Reported by octocov |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive fuzzy finder for the USE statement. While the feature significantly improves the interactive experience, there are critical logic errors in how the input context is detected and how the buffer is manipulated in multiline scenarios. Specifically, the context detection logic currently assumes the USE statement is at the very beginning of the entire multiline buffer, and the buffer replacement logic uses absolute offsets that will cause incorrect behavior or panics when the cursor is not on the first line. Additionally, a missing regular expression reference (extractDatabaseRe) will lead to compilation or runtime failures. These issues must be addressed to ensure the feature works reliably in a multiline editor environment.
…text detectFuzzyContext now operates on B.String() (current line buffer) instead of joining all editor lines. This fixes incorrect argStartPos when the cursor is not on the first line of a multiline input. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/gemini summary |
Summary of ChangesThis pull request introduces a significant enhancement to the interactive command-line interface by adding a fuzzy finder. This feature aims to improve user experience and efficiency by providing an intuitive way to select database names, reducing manual typing and potential errors. The changes involve integrating new libraries, updating existing ones, and implementing the core logic for context detection and candidate presentation, all while maintaining configurability for the end-user. Highlights
Changelog
Activity
|
Summary
USE <database>context — lists databases from current instance, pre-fills query with typed prefix, replaces argument on selectiongo-multiline-nyv0.21.0 → v0.22.4,go-readline-nyv1.9.1 → v1.14.1New system variables
CLI_ENABLE_FUZZY_FINDERtrueCLI_FUZZY_FINDER_KEYC_TBehavior
TODO (future phases)
SHOW TABLES,SHOW COLUMNS FROM,SHOW INDEX FROMSETTest plan
make checkpasses (test + lint + fmt-check)TestDetectFuzzyContextcovers USE context detection with various inputs🤖 Generated with Claude Code