From ae992762837867fee03c1ebf6618091183412f57 Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Tue, 19 May 2026 12:49:58 +0000 Subject: [PATCH] explain: typing-surface matrix cells (ADR-0028 step 5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/db.rs | 22 +++ tests/typing_surface/explain.rs | 132 ++++++++++++++++++ tests/typing_surface/mod.rs | 1 + ...ete_expects_from@after_explain_delete.snap | 39 ++++++ ...lause@after_explain_delete_from_table.snap | 47 +++++++ ...ee_explainable_commands@after_explain.snap | 55 ++++++++ ...s_table_names@after_explain_show_data.snap | 47 +++++++ ...d_limit@after_explain_show_data_table.snap | 47 +++++++ ..._show_expects_data@after_explain_show.snap | 39 ++++++ ...fers_table_names@after_explain_update.snap | 47 +++++++ ...xpects_set@after_explain_update_table.snap | 39 ++++++ ...es_as_explain@complete_explain_delete.snap | 19 +++ ...as_explain@complete_explain_show_data.snap | 19 +++ ...omplete_explain_show_data_where_limit.snap | 19 +++ ...es_as_explain@complete_explain_update.snap | 19 +++ ...ns_no_leakage@explain_show_data_where.snap | 87 ++++++++++++ 16 files changed, 678 insertions(+) create mode 100644 tests/typing_surface/explain.rs create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_expects_from@after_explain_delete.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_from_table_expects_filter_clause@after_explain_delete_from_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_offers_the_three_explainable_commands@after_explain.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_offers_table_names@after_explain_show_data.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_table_offers_where_and_limit@after_explain_show_data_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_expects_data@after_explain_show.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_offers_table_names@after_explain_update.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_table_expects_set@after_explain_update_table.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_delete_parses_as_explain@complete_explain_delete.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_parses_as_explain@complete_explain_show_data.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_with_where_and_limit_parses@complete_explain_show_data_where_limit.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_update_parses_as_explain@complete_explain_update.snap create mode 100644 tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__explain_show_data_where_offers_active_table_columns_no_leakage@explain_show_data_where.snap diff --git a/src/db.rs b/src/db.rs index e9152f8..1fdeda1 100644 --- a/src/db.rs +++ b/src/db.rs @@ -8247,6 +8247,28 @@ mod tests { ); } + #[tokio::test] + async fn explain_display_sql_writes_inequality_as_angle_brackets() { + let db = db(); + people_table(&db).await; + let plan = db + .explain_query_plan(parse_inner("show data People where Age != 35")) + .await + .unwrap(); + // ADR-0028 §3: inequality is shown as standard SQL `<>` + // even when the user typed `!=`. + assert!( + plan.display_sql.contains("<>"), + "inequality should render as `<>`: {}", + plan.display_sql, + ); + assert!( + !plan.display_sql.contains("!="), + "the `!=` spelling should not survive: {}", + plan.display_sql, + ); + } + #[tokio::test] async fn explain_of_a_missing_table_is_an_error() { let db = db(); diff --git a/tests/typing_surface/explain.rs b/tests/typing_surface/explain.rs new file mode 100644 index 0000000..dab465e --- /dev/null +++ b/tests/typing_surface/explain.rs @@ -0,0 +1,132 @@ +//! Matrix coverage for the `explain` prefix command (ADR-0028). +//! +//! `explain` wraps `show data` / `update` / `delete` through a +//! `Subgrammar`, so the inner command is parsed, completed and +//! hinted exactly as it is standalone. These cells verify the +//! prefix plugs in cleanly at each typing position and that the +//! complete forms parse as `Command::Explain`. + +use crate::typing_surface::*; +use rdbms_playground::input_render::InputState; + +#[test] +fn after_explain_offers_the_three_explainable_commands() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["show", "update", "delete"]); + crate::snap!("after_explain", a); +} + +#[test] +fn after_explain_show_expects_data() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain show ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + // `explain` covers `show data` only — not `show table`. + assert_candidate_present(&a, &["data"]); + assert_no_candidate_named(&a, &["table"]); + crate::snap!("after_explain_show", a); +} + +#[test] +fn after_explain_show_data_offers_table_names() { + let schema = schema_multi_table(); + let a = assess_at_end("explain show data ", &schema); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_explain_show_data", a); +} + +#[test] +fn after_explain_show_data_table_offers_where_and_limit() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain show data Customers ", &schema); + assert_candidate_present(&a, &["where", "limit"]); + crate::snap!("after_explain_show_data_table", a); +} + +#[test] +fn explain_show_data_where_offers_active_table_columns_no_leakage() { + let schema = schema_multi_table(); + let a = assess_at_end("explain show data Customers where ", &schema); + assert_candidate_present(&a, &["id", "Name"]); + assert_no_candidate_named(&a, &["OrderId", "CustId", "Total"]); + crate::snap!("explain_show_data_where", a); +} + +#[test] +fn complete_explain_show_data_parses_as_explain() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain show data Customers", &schema); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("Explain")); + crate::snap!("complete_explain_show_data", a); +} + +#[test] +fn complete_explain_show_data_with_where_and_limit_parses() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "explain show data Customers where id = 1 limit 5", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("Explain")); + crate::snap!("complete_explain_show_data_where_limit", a); +} + +#[test] +fn after_explain_update_offers_table_names() { + let schema = schema_multi_table(); + let a = assess_at_end("explain update ", &schema); + assert_candidate_present(&a, &["Customers", "Orders"]); + crate::snap!("after_explain_update", a); +} + +#[test] +fn after_explain_update_table_expects_set() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain update Customers ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["set"]); + crate::snap!("after_explain_update_table", a); +} + +#[test] +fn complete_explain_update_parses_as_explain() { + let schema = schema_serial_pk(); + let a = assess_at_end( + "explain update Customers set Name='Bo' where id=1", + &schema, + ); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("Explain")); + crate::snap!("complete_explain_update", a); +} + +#[test] +fn after_explain_delete_expects_from() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain delete ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["from"]); + crate::snap!("after_explain_delete", a); +} + +#[test] +fn after_explain_delete_from_table_expects_filter_clause() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain delete from Customers ", &schema); + assert!(matches!(a.state, InputState::IncompleteAtEof)); + assert_candidate_present(&a, &["where", "--all-rows"]); + crate::snap!("after_explain_delete_from_table", a); +} + +#[test] +fn complete_explain_delete_parses_as_explain() { + let schema = schema_serial_pk(); + let a = assess_at_end("explain delete from Customers where id=1", &schema); + assert!(matches!(a.state, InputState::Valid)); + assert_eq!(a.parse_result.as_deref(), Ok("Explain")); + crate::snap!("complete_explain_delete", a); +} diff --git a/tests/typing_surface/mod.rs b/tests/typing_surface/mod.rs index a3d4dbc..0c2cfc7 100644 --- a/tests/typing_surface/mod.rs +++ b/tests/typing_surface/mod.rs @@ -29,6 +29,7 @@ pub mod update_all_rows; pub mod delete_with_where; pub mod where_expression; pub mod delete_all_rows; +pub mod explain; pub mod create_table; pub mod drop_column; pub mod drop_relationship; diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_expects_from@after_explain_delete.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_expects_from@after_explain_delete.snap new file mode 100644 index 0000000..de7eb4f --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_expects_from@after_explain_delete.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_from_table_expects_filter_clause@after_explain_delete_from_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_from_table_expects_filter_clause@after_explain_delete_from_table.snap new file mode 100644 index 0000000..1ba435f --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_delete_from_table_expects_filter_clause@after_explain_delete_from_table.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_offers_the_three_explainable_commands@after_explain.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_offers_the_three_explainable_commands@after_explain.snap new file mode 100644 index 0000000..59cb028 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_offers_the_three_explainable_commands@after_explain.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_offers_table_names@after_explain_show_data.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_offers_table_names@after_explain_show_data.snap new file mode 100644 index 0000000..a5614cb --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_offers_table_names@after_explain_show_data.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_table_offers_where_and_limit@after_explain_show_data_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_table_offers_where_and_limit@after_explain_show_data_table.snap new file mode 100644 index 0000000..832fc45 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_data_table_offers_where_and_limit@after_explain_show_data_table.snap @@ -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", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_expects_data@after_explain_show.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_expects_data@after_explain_show.snap new file mode 100644 index 0000000..ba1d1c4 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_show_expects_data@after_explain_show.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_offers_table_names@after_explain_update.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_offers_table_names@after_explain_update.snap new file mode 100644 index 0000000..3f746f8 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_offers_table_names@after_explain_update.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_table_expects_set@after_explain_update_table.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_table_expects_set@after_explain_update_table.snap new file mode 100644 index 0000000..ce62854 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__after_explain_update_table_expects_set@after_explain_update_table.snap @@ -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)", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_delete_parses_as_explain@complete_explain_delete.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_delete_parses_as_explain@complete_explain_delete.snap new file mode 100644 index 0000000..29b5f30 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_delete_parses_as_explain@complete_explain_delete.snap @@ -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", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_parses_as_explain@complete_explain_show_data.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_parses_as_explain@complete_explain_show_data.snap new file mode 100644 index 0000000..0fe4364 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_parses_as_explain@complete_explain_show_data.snap @@ -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", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_with_where_and_limit_parses@complete_explain_show_data_where_limit.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_with_where_and_limit_parses@complete_explain_show_data_where_limit.snap new file mode 100644 index 0000000..39bda87 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_show_data_with_where_and_limit_parses@complete_explain_show_data_where_limit.snap @@ -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", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_update_parses_as_explain@complete_explain_update.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_update_parses_as_explain@complete_explain_update.snap new file mode 100644 index 0000000..4767be7 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__complete_explain_update_parses_as_explain@complete_explain_update.snap @@ -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", + ), +} diff --git a/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__explain_show_data_where_offers_active_table_columns_no_leakage@explain_show_data_where.snap b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__explain_show_data_where_offers_active_table_columns_no_leakage@explain_show_data_where.snap new file mode 100644 index 0000000..124e748 --- /dev/null +++ b/tests/typing_surface/snapshots/typing_surface_matrix__typing_surface__explain__explain_show_data_where_offers_active_table_columns_no_leakage@explain_show_data_where.snap @@ -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)", + ), +}