feat(fuzzy-finder): add variable value completion for SET statements#510
feat(fuzzy-finder): add variable value completion for SET statements#510
Conversation
Add fuzzy completion for SET <name> = <Ctrl+T> that shows valid values for enum-type variables. Values are returned as proper GoogleSQL literals (single-quoted strings for enums, bare TRUE/FALSE for booleans). Also adds " = " suffix to SET variable name completion so selecting a variable name produces "SET <name> = " ready for value input. Key changes: - ValidValuesEnumerator interface for variables with constrained values - Implement on BoolVar, EnumVar[T], ProtoEnumVar[T] - fuzzyCompleteVariableValue completion type with 2-group regex - detectFuzzyContext uses last capture group as argPrefix - Suffix field on fuzzyArgCompletion for post-selection text Fixes #509 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 fuzzy finder's capabilities by introducing intelligent completion for 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 (08d52cc) | #510 (3d5cd7d) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 68.8% | 68.5% | -0.4% |
| Files | 55 | 55 | 0 |
| Lines | 5843 | 5879 | +36 |
+ | Covered | 4024 | 4031 | +7 |
- | Code to Test Ratio | 1:1.2 | 1:1.2 | -0.1 |
| Code | 13432 | 13514 | +82 |
+ | Test | 16859 | 16900 | +41 |
- | Test Execution Time | 1m6s | 1m7s | +1s |Code coverage of files in pull request scope (75.5% → 73.0%)
Reported by octocov |
- CLI_QUERY_MODE: change CustomVar base from dummy StringVar to QueryModeVar so unwrapCustomVar exposes ValidValuesEnumerator - LogLevelVar: implement ValidValues() returning standard log levels Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces fuzzy completion for variable values in SET statements, significantly improving the user experience for configuring system variables. While the implementation is well-integrated, follows Go idioms, and includes comprehensive test coverage, a high-severity Local File Inclusion (LFI) vulnerability was identified. This vulnerability, located in a modified file but not directly on the changed lines, allows an attacker to read arbitrary files from the local filesystem by maliciously setting a specific system variable. Addressing this security concern is critical.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant enhancement to the fuzzy finder by adding variable value completion for SET statements. The implementation is clean, idiomatic, and leverages Go 1.25 features as specified in the repository style guide. Key improvements include the generalization of detectFuzzyContext to handle context (like variable names), the addition of the ValidValuesEnumerator interface to provide constrained candidates for enums and booleans, and a UX improvement where selecting a variable name automatically appends the = suffix. The use of GoogleSQL literals (quoted strings for enums, bare TRUE/FALSE for booleans) ensures consistency with the tool's parser. The test coverage has been appropriately expanded to verify the new completion logic.
|
/gemini summary |
Summary of ChangesThis pull request significantly enhances the fuzzy finder's capabilities by introducing intelligent completion for Highlights
Changelog
Activity
|
Summary
SET <name> = <Ctrl+T>showing valid values for enum-type variables (~15 enum/proto-enum vars + ~30 boolean vars)'TABLE'), bareTRUE/FALSEfor booleans=suffix soSET <Ctrl+T>→ selectCLI_FORMAT→SET CLI_FORMAT =(ready for value input or another Ctrl+T)detectFuzzyContextgeneralized to use last capture group as argPrefix, earlier groups as contextTest plan
make checkpasses (test + lint + fmt-check)TestDetectFuzzyContextexpanded with 6 value completion cases (SET FORMAT =,SET FORMAT = TA,SET FORMAT=,SET READONLY =, etc.)SET CLI_FORMAT = <Ctrl+T>shows'TABLE'/'VERTICAL'/etc.SET READONLY = <Ctrl+T>showsTRUE/FALSE(unquoted)SET <Ctrl+T>→ select var → inserts<name> =Fixes #509
🤖 Generated with Claude Code