fix: insert VALUES between-values hint points at comma not close-paren
The ambient-hint fallback in ambient_hint_core_in_mode parsed schemalessly, so the type-blind grammar closed an `insert … values (…)` tuple after the first value and the "Next:" hint pointed at `)`. With a schema available the walk knows the remaining columns and the correct next token is `,`. Parse the fallback with the schema cache so the expected-token prose matches the rest of the (already schema-aware) hint ladder. Also corrects wrong-arity closed tuples where the schemaless parse accepted the input and the hint said "submit with Enter" for a command the schema-aware parse rejects — the hint now surfaces the accurate error. Three typing-surface snapshots updated to match. Docs: ADR-0022 Amendment 3 (+ README index) records the schema-aware fallback; requirements.md H1a cites the hint-accuracy improvement.
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/insert_form_a.rs
|
||||
assertion_line: 243
|
||||
description: "input=\"insert into Orders (OrderId, CustId, Total) values (42\" cursor=54"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -9,7 +10,7 @@ Assessment {
|
||||
state: IncompleteAtEof,
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Next: `)`",
|
||||
"Next: `,`",
|
||||
),
|
||||
),
|
||||
completion: None,
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/insert_form_b.rs
|
||||
assertion_line: 168
|
||||
description: "input=\"insert into Customers values ('Alice')\" cursor=38"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -11,7 +12,7 @@ Assessment {
|
||||
),
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
"after `insert into Customers values ('Alice'`, expected `,` — usage: insert into <Table> [(<col>[, ...])] [values] (<value>[, ...])",
|
||||
),
|
||||
),
|
||||
completion: None,
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/insert_form_c.rs
|
||||
assertion_line: 101
|
||||
description: "input=\"insert into Customers ('Alice', 'a@b.c', 'extra')\" cursor=49"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -11,7 +12,7 @@ Assessment {
|
||||
),
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
"after `insert into Customers ('Alice', 'a@b.c'`, expected `)` — usage: insert into <Table> [(<col>[, ...])] [values] (<value>[, ...])",
|
||||
),
|
||||
),
|
||||
completion: None,
|
||||
|
||||
Reference in New Issue
Block a user