feat(fuzzy-finder): add per-type fuzzy completion for SHOW CREATE#528
feat(fuzzy-finder): add per-type fuzzy completion for SHOW CREATE#528
Conversation
Add argument completion for SHOW CREATE <type> so that pressing Ctrl+T after the type keyword suggests matching schema objects from INFORMATION_SCHEMA. Supports VIEW, INDEX, CHANGE STREAM, SEQUENCE, and MODEL with TTL-based caching and schema-generation awareness. Extract fetchSchemaObjectCandidates shared helper to reduce boilerplate across all INFORMATION_SCHEMA-based fetch functions, and refactor fetchTableCandidates to use it. 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 improves the user experience 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 (1955708) | #528 (400078b) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 67.9% | 67.5% | -0.4% |
| Files | 55 | 55 | 0 |
| Lines | 6039 | 6074 | +35 |
| Covered | 4101 | 4101 | 0 |
- | Code to Test Ratio | 1:1.2 | 1:1.2 | -0.1 |
| Code | 13819 | 13939 | +120 |
+ | Test | 17235 | 17340 | +105 |
+ | Test Execution Time | 2m8s | 1m10s | -58s |Code coverage of files in pull request scope (53.0% → 49.6%)
Reported by octocov |
There was a problem hiding this comment.
Code Review
This pull request adds fuzzy completion for several SHOW CREATE object types, including views, indexes, change streams, sequences, and models. This is achieved by adding new completion definitions and corresponding data-fetching logic. The implementation introduces a generic fetchSchemaObjectCandidates function to query INFORMATION_SCHEMA tables, which is then used by specific fetchers for each object type. Caching is extended to support the new object types. The changes also include unit tests for the new completion contexts. The implementation is consistent with the existing fuzzy-finder architecture. No issues were found during the review.
Summary
Add per-type fuzzy completion for
SHOW CREATE <type>so that pressing Ctrl+T after the type keyword suggests matching schema objects. Supports 5 types: VIEW, INDEX, CHANGE STREAM, SEQUENCE, and MODEL.Key Changes
fuzzyCompletionTypeconstants andCompletionentries on the existing SHOW CREATE definition with prefix patterns (CHANGE STREAM ordered first since it's multi-word)fetchSchemaObjectCandidatesshared helper for INFORMATION_SCHEMA queries, refactorfetchTableCandidatesto use it, add 5 new fetch functions (fetchViewCandidates,fetchIndexCandidates,fetchChangeStreamCandidates,fetchSequenceCandidates,fetchModelCandidates), 5 cache fields with schema-generation awareness, and update all switch statements (requiresNetwork,getCachedCandidates,setCachedCandidates,fetchCandidates,completionHeader)TestDetectFuzzyContextcovering trailing space, partial name, and case-insensitive matchingDevelopment Insights
Design Decision
Instead of the original "hidden statement definitions" approach from the issue, we add multiple
Completionentries to the existing SHOW CREATEclientSideStatementDef. This follows the established pattern (USE has database+role, SET has variable+value) and avoids new infrastructure.INFORMATION_SCHEMA Column Names
Each table has different naming conventions: VIEWS uses
TABLE_SCHEMA/TABLE_NAME, INDEXES usesTABLE_SCHEMA/INDEX_NAME, CHANGE_STREAMS usesCHANGE_STREAM_SCHEMA/CHANGE_STREAM_NAME, SEQUENCES usesSCHEMA/NAME, MODELS usesMODEL_SCHEMA/MODEL_NAME.Not in Scope
TABLE (#512/#518), ROLE (#513), SCHEMA (#520) — tracked separately.
Test Plan
make checkpasses (test + lint + fmt-check)TestDetectFuzzyContextcovers prefix pattern matching for all 5 typesFixes #519