You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split out from #17. Tracking epic — do not start without a design doc.
Why this is an epic, not a follow-up
alias. completion requires a semantic resolver that understands:
FROM / JOIN scope introduction,
CTE visibility,
subquery and lateral scopes,
correlated references,
implicit alias shadowing.
This is a separate subsystem, not a completion-provider tweak.
Gate
Do not start before the basic IntelliSense issue ships and the flat-model refactor lands. A design doc at docs/design/semantic-resolver.md should precede any implementation work.
Closing — implemented. Gates from the issue are both satisfied (#26 shipped, #19 flat-model landed).
Where it lives
crates/flowscope-core/src/completion/context.rs:
`extract_qualifier()` at :1258 — parses the cursor prefix to find the qualifier before a `.` (trailing dot, mid-token, multi-dot `schema.table.`, UTF-8 boundaries, quoted identifiers)
`resolve_qualifier()` at :1417 — resolves against table aliases, bare table names, schema names, catalog names, and schema-qualified tables. Returns a `QualifierResolution` with target `ColumnLabel | SchemaTable | SchemaOnly`
`schema_tables_for_qualifier()` at :1363 — tables for a schema qualifier
`build_columns_for_table()` at :1322 — column filtering to the resolved table
Scope collection is in `crates/flowscope-core/src/completion/ast_extractor.rs`, producing a flat `tables_in_scope: Vec`.
Test coverage — `crates/flowscope-core/tests/completion_items.rs`
The "implicit alias shadowing" bullet from the original gate is genuinely not handled: when the same alias name is bound at multiple nesting levels within one statement, `tables_in_scope` unions both bindings rather than picking the enclosing scope. Two `#[ignore]`-d tests (`alias_shadowing_inner_subquery_wins`, `alias_shadowing_outer_scope_unaffected`) live in the repo as executable acceptance criteria for #41. Cross-statement shadowing already works via statement-level isolation.
Activity
melonamin commentedon Apr 21, 2026
Closing — implemented. Gates from the issue are both satisfied (#26 shipped, #19 flat-model landed).
Where it lives
crates/flowscope-core/src/completion/context.rs:Scope collection is in `crates/flowscope-core/src/completion/ast_extractor.rs`, producing a flat `tables_in_scope: Vec`.
Test coverage — `crates/flowscope-core/tests/completion_items.rs`
Lateral aliases are covered by `completion_items_do_not_leak_lateral_aliases_across_statements` at :234 and the scoping suite.
`cargo test -p flowscope-core --test completion_items` → 97 passed.
Remaining gap — tracked separately in #41
The "implicit alias shadowing" bullet from the original gate is genuinely not handled: when the same alias name is bound at multiple nesting levels within one statement, `tables_in_scope` unions both bindings rather than picking the enclosing scope. Two `#[ignore]`-d tests (`alias_shadowing_inner_subquery_wins`, `alias_shadowing_outer_scope_unaffected`) live in the repo as executable acceptance criteria for #41. Cross-statement shadowing already works via statement-level isolation.