Do we expect to hint/complete table aliases? #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This query text:
Hint panel says "no such column
oon tableOrders, OrderLines, Products, Customers" - not sure whether we expect to hint/complete theoalias here, but the hint message is misleading in any case.Fixed in
7e4bc12.Both halves of the report addressed:
Misleading message — a bare in-scope table alias (
o) used where a column is expected no longer reportsno such column o on table Orders, .... It now emits a targeted hint:o` is a table alias — write `o.<column>` to reference one of its columns(and thetable_used_as_columnvariant for an un-aliased table source). It's a drop-in replacement forunknown_columnat the same span/Error severity, so the validity indicator, token overlay and hint panel behave exactly as before — only the wording changes.Hint/complete the alias — yes, we now do. At a bare SQL-expression slot (projection /
WHERE/GROUP BY/HAVING, not already past aqualifier.) completion offers each FROM source's qualifier (its alias if it has one, else the table name) as a Tab candidate, soois discoverable on the way too.<column>. On an exact-alias partial the alias source steps aside so the targeted hint surfaces instead of sibling-alias noise.Two correctness guards (each with regression tests):
role == "sql_expr_ident". The simple-mode DSLExprreaches the same code path but has notable.columnsyntax, so a DSL bare table-name ref keeps the genericunknown_column(advising the qualified form there would be wrong).FROM a x … GROUP BY ais invalid SQL, so the shadowed real nameafalls through tounknown_columnrather than being advised asa.<column>.A genuine unknown column still reports
no such columnverbatim.Decision recorded in ADR-0032 Amendment 3. +10 tests; full suite green (2417 pass, 1 ignored).