explain: typing-surface matrix cells (ADR-0028 step 5)

13 matrix cells for the `explain` prefix across all three
wrapped commands — `explain show data` / `explain update` /
`explain delete` — covering each typing position (after the
prefix, the inner entry word, the table, the filter clause)
plus the three complete forms. The cells confirm `explain`
plugs into the inner query grammars cleanly: candidates, hints
and column scoping match the standalone commands, and the
complete forms parse as `Command::Explain`.

Also adds a worker test pinning the display SQL's `<>`
rendering of inequality (ADR-0028 §3).

Matrix: 161 -> 174 cells. 1172 tests pass; clippy clean.
This commit is contained in:
claude@clouddev1
2026-05-19 12:49:58 +00:00
parent a7d459f8f2
commit ae99276283
16 changed files with 678 additions and 0 deletions
@@ -0,0 +1,39 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain delete \" cursor=15"
expression: "& a"
---
Assessment {
input: "explain delete ",
cursor: 15,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "from",
kind: Keyword,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
15,
15,
),
partial_prefix: "",
candidates: [
Candidate {
text: "from",
kind: Keyword,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,47 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain delete from Customers \" cursor=30"
expression: "& a"
---
Assessment {
input: "explain delete from Customers ",
cursor: 30,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "where",
kind: Keyword,
},
Candidate {
text: "--all-rows",
kind: Flag,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
30,
30,
),
partial_prefix: "",
candidates: [
Candidate {
text: "where",
kind: Keyword,
},
Candidate {
text: "--all-rows",
kind: Flag,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,55 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain \" cursor=8"
expression: "& a"
---
Assessment {
input: "explain ",
cursor: 8,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "show",
kind: Keyword,
},
Candidate {
text: "update",
kind: Keyword,
},
Candidate {
text: "delete",
kind: Keyword,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
8,
8,
),
partial_prefix: "",
candidates: [
Candidate {
text: "show",
kind: Keyword,
},
Candidate {
text: "update",
kind: Keyword,
},
Candidate {
text: "delete",
kind: Keyword,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,47 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show data \" cursor=18"
expression: "& a"
---
Assessment {
input: "explain show data ",
cursor: 18,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "Customers",
kind: Identifier,
},
Candidate {
text: "Orders",
kind: Identifier,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
18,
18,
),
partial_prefix: "",
candidates: [
Candidate {
text: "Customers",
kind: Identifier,
},
Candidate {
text: "Orders",
kind: Identifier,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,47 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show data Customers \" cursor=28"
expression: "& a"
---
Assessment {
input: "explain show data Customers ",
cursor: 28,
state: Valid,
hint: Some(
Candidates {
items: [
Candidate {
text: "where",
kind: Keyword,
},
Candidate {
text: "limit",
kind: Keyword,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
28,
28,
),
partial_prefix: "",
candidates: [
Candidate {
text: "where",
kind: Keyword,
},
Candidate {
text: "limit",
kind: Keyword,
},
],
},
),
parse_result: Ok(
"Explain",
),
}
@@ -0,0 +1,39 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show \" cursor=13"
expression: "& a"
---
Assessment {
input: "explain show ",
cursor: 13,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "data",
kind: Keyword,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
13,
13,
),
partial_prefix: "",
candidates: [
Candidate {
text: "data",
kind: Keyword,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,47 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain update \" cursor=15"
expression: "& a"
---
Assessment {
input: "explain update ",
cursor: 15,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "Customers",
kind: Identifier,
},
Candidate {
text: "Orders",
kind: Identifier,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
15,
15,
),
partial_prefix: "",
candidates: [
Candidate {
text: "Customers",
kind: Identifier,
},
Candidate {
text: "Orders",
kind: Identifier,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,39 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain update Customers \" cursor=25"
expression: "& a"
---
Assessment {
input: "explain update Customers ",
cursor: 25,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "set",
kind: Keyword,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
25,
25,
),
partial_prefix: "",
candidates: [
Candidate {
text: "set",
kind: Keyword,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}
@@ -0,0 +1,19 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain delete from Customers where id=1\" cursor=40"
expression: "& a"
---
Assessment {
input: "explain delete from Customers where id=1",
cursor: 40,
state: Valid,
hint: Some(
Prose(
"Submit with Enter",
),
),
completion: None,
parse_result: Ok(
"Explain",
),
}
@@ -0,0 +1,19 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show data Customers\" cursor=27"
expression: "& a"
---
Assessment {
input: "explain show data Customers",
cursor: 27,
state: Valid,
hint: Some(
Prose(
"Submit with Enter",
),
),
completion: None,
parse_result: Ok(
"Explain",
),
}
@@ -0,0 +1,19 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show data Customers where id = 1 limit 5\" cursor=48"
expression: "& a"
---
Assessment {
input: "explain show data Customers where id = 1 limit 5",
cursor: 48,
state: Valid,
hint: Some(
Prose(
"Submit with Enter",
),
),
completion: None,
parse_result: Ok(
"Explain",
),
}
@@ -0,0 +1,19 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain update Customers set Name='Bo' where id=1\" cursor=49"
expression: "& a"
---
Assessment {
input: "explain update Customers set Name='Bo' where id=1",
cursor: 49,
state: Valid,
hint: Some(
Prose(
"Submit with Enter",
),
),
completion: None,
parse_result: Ok(
"Explain",
),
}
@@ -0,0 +1,87 @@
---
source: tests/typing_surface/explain.rs
description: "input=\"explain show data Customers where \" cursor=34"
expression: "& a"
---
Assessment {
input: "explain show data Customers where ",
cursor: 34,
state: IncompleteAtEof,
hint: Some(
Candidates {
items: [
Candidate {
text: "not",
kind: Keyword,
},
Candidate {
text: "null",
kind: Keyword,
},
Candidate {
text: "true",
kind: Keyword,
},
Candidate {
text: "false",
kind: Keyword,
},
Candidate {
text: "(",
kind: Punct,
},
Candidate {
text: "Name",
kind: Identifier,
},
Candidate {
text: "id",
kind: Identifier,
},
],
selected: None,
},
),
completion: Some(
Completion {
replaced_range: (
34,
34,
),
partial_prefix: "",
candidates: [
Candidate {
text: "not",
kind: Keyword,
},
Candidate {
text: "null",
kind: Keyword,
},
Candidate {
text: "true",
kind: Keyword,
},
Candidate {
text: "false",
kind: Keyword,
},
Candidate {
text: "(",
kind: Punct,
},
Candidate {
text: "Name",
kind: Identifier,
},
Candidate {
text: "id",
kind: Identifier,
},
],
},
),
parse_result: Err(
"Invalid(at_eof)",
),
}