Repository navigation
refactor: share SQL analysis and enforce type safety - #238
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
any, casts, non-null assertions, and TypeScript suppressions. Validate external ASTs into stricter internal representations while preserving extensible public parser/result and namespace interfaces.Existing sanitizer subclass hooks, per-feature parser defaults, and peer dependency requirements remain compatible. A parser configured through
linterConfigstill applies to syntax linting, semantic linting, and navigation, while hover and gutter retain independent defaults. Sharing a custom parser across all features is opt-in through the new top-level analysis options.createSqlAnalysisshares dependencies across extension and completion bundles.needsRefreshrefreshes linting and gutter state when parser configuration changes without an edit. The unused hoverdialectoption is deprecated for compatibility.The demo normalizes all six dialect choices, updates parser state and SQL language together, and re-registers schema-aware completion sources when switching languages.
Review follow-up preserves array and subscript statement boundaries, restores column-completion fallback when namespace names collide, and distinguishes CAST types from binding declarations. Gutter selection and focus updates reuse analysis; comment stripping avoids repeatedly processing accumulated output.
The built-in parser now reuses parse, structure, and query-context analysis across cursor-only states with the same document and options. Dialect and parser-option changes still invalidate results. Custom parsers and subclasses remain state-scoped unless they provide
getCacheKey(state). Document caches use weak ownership and bound configuration variants. Comment stripping walks quoted/comment spans without constructing the full token list.The scanner preserves the original first-closing-bracket and non-nested block-comment behavior. Pending gutter markers map through edits until fresh analysis arrives, so asynchronous parsers do not clear the gutter on each keystroke.
User-visible dialect correction:
BigQueryDialectnow inherits PostgreSQL keyword and type definitions fromPostgreSQL.spec, fixing its base dialect configuration.