walker+completion: surface list trailing-optionals + identifiers-first ordering (ADR-0022 Amendment 2)
walk_repeated discarded the last matched item's trailing-optional expectations at a clean item boundary, so a comma-separated list offered no continuation after a complete item: `order by Name ` gave no asc/desc, `select Name ` no `as`, `create table … Code(text) ` no not/unique/default/check. Capture the last item's skipped set and surface it when the list ends at an item boundary (the separator `,` itself is deliberately not surfaced). That fix made expression-position candidate lists long, which exposed a visibility problem: the hint panel's candidate line is single-row and window-scrolls on overflow, centring on item 0 when nothing is selected — so with keywords-first, schema identifiers scrolled off behind the `>` marker. Reverse the ordering: schema identifiers (table/column/relationship names) now sort before keywords, since a name the user would have to look up is the highest-value completion and must stay visible (keywords are learned over time; the tok_identifier/tok_keyword colour split marks the boundary). This reverses the handoff-14 keywords-first call, now recorded in ADR-0022 Amendment 2. Tests: walker expected-set + completion-layer regressions for the trailing-optionals and the ordering; candidate_ordering.rs header invariant inverted; ~20 typing-surface snapshots re-baselined; a two-line hint box recorded as a deferred follow-up.
This commit is contained in:
@@ -1,21 +1,24 @@
|
||||
//! Matrix coverage for completion-candidate *ordering*.
|
||||
//!
|
||||
//! The order candidates appear in is load-bearing for the hint
|
||||
//! panel: it reads left-to-right, so the sequence must match
|
||||
//! how the command is spoken. Two invariants the user called
|
||||
//! out (handoff-14 ranker discussion):
|
||||
//! panel: the candidate line is single-row and window-scrolls
|
||||
//! when it overflows, so whatever sits first is what stays
|
||||
//! visible by default. Two invariants:
|
||||
//!
|
||||
//! 1. Connective keywords appear in grammar-declaration / reading
|
||||
//! order — `to` before `table` so `add column to table T`
|
||||
//! reads correctly, never the jarring `table` / `to`.
|
||||
//! 2. Command-part keywords appear before schema identifiers
|
||||
//! (table / column names) — grammar parts are read before
|
||||
//! the content that fills them.
|
||||
//! 2. Schema identifiers (table / column names) appear *before*
|
||||
//! command-part keywords. A name the user would otherwise
|
||||
//! have to look up is the highest-value completion — valuable
|
||||
//! even to experts, who come to know the keywords over time —
|
||||
//! so it must stay visible by default rather than scroll off
|
||||
//! behind the keyword run. (ADR-0022 Amendment 2; reverses the
|
||||
//! earlier handoff-14 keywords-first call, which held only
|
||||
//! while candidate lists were short.)
|
||||
//!
|
||||
//! These hold today via declaration-order preservation +
|
||||
//! keywords-first sectioning in `candidates_at_cursor`. Nothing
|
||||
//! pinned them until now, so a future grammar/sort change could
|
||||
//! silently break the reading order.
|
||||
//! These hold via declaration-order preservation +
|
||||
//! identifiers-first sectioning in `candidates_at_cursor`.
|
||||
|
||||
use crate::typing_surface::*;
|
||||
|
||||
@@ -78,30 +81,30 @@ fn change_column_lists_in_before_table() {
|
||||
}
|
||||
|
||||
// =========================================================
|
||||
// Keywords-before-identifiers: at a position where both a
|
||||
// Identifiers-before-keywords: at a position where both a
|
||||
// connective keyword and schema table names are valid, the
|
||||
// keyword comes first.
|
||||
// schema identifiers come first (ADR-0022 Amendment 2).
|
||||
// =========================================================
|
||||
|
||||
#[test]
|
||||
fn add_column_keyword_precedes_table_identifiers() {
|
||||
fn add_column_identifiers_precede_table_keywords() {
|
||||
let schema = schema_multi_table();
|
||||
let a = assess_at_end("add column ", &schema);
|
||||
// `to` / `table` are command parts; Customers / Orders are
|
||||
// schema identifiers — every keyword precedes every ident.
|
||||
assert_before(&a, "table", "Customers");
|
||||
assert_before(&a, "to", "Customers");
|
||||
assert_before(&a, "to", "Orders");
|
||||
crate::snap!("add_column_keyword_then_idents", a);
|
||||
// Customers / Orders are schema identifiers; `to` / `table`
|
||||
// are command parts — every ident precedes every keyword.
|
||||
assert_before(&a, "Customers", "table");
|
||||
assert_before(&a, "Customers", "to");
|
||||
assert_before(&a, "Orders", "to");
|
||||
crate::snap!("add_column_idents_then_keyword", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn drop_column_keyword_precedes_table_identifiers() {
|
||||
fn drop_column_identifiers_precede_table_keywords() {
|
||||
let schema = schema_multi_table();
|
||||
let a = assess_at_end("drop column ", &schema);
|
||||
assert_before(&a, "table", "Customers");
|
||||
assert_before(&a, "from", "Orders");
|
||||
crate::snap!("drop_column_keyword_then_idents", a);
|
||||
assert_before(&a, "Customers", "table");
|
||||
assert_before(&a, "Orders", "from");
|
||||
crate::snap!("drop_column_idents_then_keyword", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -116,14 +119,14 @@ fn insert_into_table_keyword_precedes_nothing_when_only_idents() {
|
||||
}
|
||||
|
||||
// =========================================================
|
||||
// After consuming the first connective, the second still
|
||||
// surfaces ahead of identifiers.
|
||||
// After consuming the first connective, identifiers still
|
||||
// surface ahead of the remaining keyword.
|
||||
// =========================================================
|
||||
|
||||
#[test]
|
||||
fn add_column_after_to_lists_table_before_identifiers() {
|
||||
fn add_column_after_to_lists_identifiers_before_table() {
|
||||
let schema = schema_multi_table();
|
||||
let a = assess_at_end("add column to ", &schema);
|
||||
assert_before(&a, "table", "Customers");
|
||||
assert_before(&a, "Customers", "table");
|
||||
crate::snap!("add_column_after_to", a);
|
||||
}
|
||||
|
||||
+9
-8
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 131
|
||||
description: "input=\"add column to \" cursor=14"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,10 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -22,6 +19,10 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -34,10 +35,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -46,6 +43,10 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 98
|
||||
description: "input=\"add column \" cursor=11"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 56
|
||||
description: "input=\"add column \" cursor=11"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "to",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 80
|
||||
description: "input=\"change column \" cursor=14"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 107
|
||||
description: "input=\"drop column \" cursor=12"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 64
|
||||
description: "input=\"drop column \" cursor=12"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/candidate_ordering.rs
|
||||
assertion_line: 72
|
||||
description: "input=\"rename column \" cursor=14"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -26,6 +19,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -38,14 +39,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -54,6 +47,14 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "in",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+49
-4
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/constraints.rs
|
||||
assertion_line: 30
|
||||
description: "input=\"create table Ages with pk age(int) check (age >= 0)\" cursor=51"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -8,11 +9,55 @@ Assessment {
|
||||
cursor: 51,
|
||||
state: Valid,
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
),
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
),
|
||||
completion: Some(
|
||||
Completion {
|
||||
replaced_range: (
|
||||
51,
|
||||
51,
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
completion: None,
|
||||
parse_result: Ok(
|
||||
"CreateTable",
|
||||
),
|
||||
|
||||
+49
-4
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/constraints.rs
|
||||
assertion_line: 19
|
||||
description: "input=\"create table Books with pk isbn(text) default '000'\" cursor=51"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -8,11 +9,55 @@ Assessment {
|
||||
cursor: 51,
|
||||
state: Valid,
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
),
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
),
|
||||
completion: Some(
|
||||
Completion {
|
||||
replaced_range: (
|
||||
51,
|
||||
51,
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
completion: None,
|
||||
parse_result: Ok(
|
||||
"CreateTable",
|
||||
),
|
||||
|
||||
+49
-4
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/create_table.rs
|
||||
assertion_line: 117
|
||||
description: "input=\"create table Memberships with pk UserId(int), GroupId(int)\" cursor=58"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -8,11 +9,55 @@ Assessment {
|
||||
cursor: 58,
|
||||
state: Valid,
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
),
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
),
|
||||
completion: Some(
|
||||
Completion {
|
||||
replaced_range: (
|
||||
58,
|
||||
58,
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
completion: None,
|
||||
parse_result: Ok(
|
||||
"CreateTable",
|
||||
),
|
||||
|
||||
+49
-4
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/create_table.rs
|
||||
assertion_line: 106
|
||||
description: "input=\"create table Customers with pk Code(text)\" cursor=41"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -8,11 +9,55 @@ Assessment {
|
||||
cursor: 41,
|
||||
state: Valid,
|
||||
hint: Some(
|
||||
Prose(
|
||||
"Submit with Enter",
|
||||
),
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
),
|
||||
completion: Some(
|
||||
Completion {
|
||||
replaced_range: (
|
||||
41,
|
||||
41,
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "unique",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "default",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "check",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
completion: None,
|
||||
parse_result: Ok(
|
||||
"CreateTable",
|
||||
),
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/delete_with_where.rs
|
||||
assertion_line: 60
|
||||
description: "input=\"delete from Customers where Email=\" cursor=34"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -20,18 +21,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
@@ -44,6 +33,18 @@ Assessment {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/delete_with_where.rs
|
||||
assertion_line: 39
|
||||
description: "input=\"delete from Customers where \" cursor=28"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,6 +11,14 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -30,14 +39,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -50,6 +51,14 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -70,14 +79,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/delete_with_where.rs
|
||||
assertion_line: 86
|
||||
description: "input=\"delete from Things where ts=\" cursor=28"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -20,18 +21,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "auto",
|
||||
kind: Identifier,
|
||||
@@ -72,6 +61,18 @@ Assessment {
|
||||
text: "ts",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+9
-8
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/drop_column.rs
|
||||
assertion_line: 19
|
||||
description: "input=\"drop column from \" cursor=17"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,10 +11,6 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -22,6 +19,10 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -34,10 +35,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Customers",
|
||||
kind: Identifier,
|
||||
@@ -46,6 +43,10 @@ Assessment {
|
||||
text: "Orders",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "table",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+9
-8
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/drop_relationship.rs
|
||||
assertion_line: 37
|
||||
description: "input=\"drop relationship \" cursor=18"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,14 +11,14 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Orders_CustId_to_Customers",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -30,14 +31,14 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Orders_CustId_to_Customers",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "from",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/explain.rs
|
||||
assertion_line: 54
|
||||
description: "input=\"explain show data Customers where \" cursor=34"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,6 +11,14 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -30,14 +39,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -50,6 +51,14 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -70,14 +79,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/update_with_where.rs
|
||||
assertion_line: 152
|
||||
description: "input=\"update Customers set Email='x' where id=\" cursor=40"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -20,18 +21,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
@@ -44,6 +33,18 @@ Assessment {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+17
-16
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/update_with_where.rs
|
||||
assertion_line: 135
|
||||
description: "input=\"update Customers set Name='x' where \" cursor=36"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,6 +11,14 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -30,14 +39,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -50,6 +51,14 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -70,14 +79,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+25
-24
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/where_expression.rs
|
||||
assertion_line: 42
|
||||
description: "input=\"delete from Customers where not \" cursor=32"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -10,6 +11,18 @@ Assessment {
|
||||
hint: Some(
|
||||
Candidates {
|
||||
items: [
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -30,18 +43,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
selected: None,
|
||||
},
|
||||
@@ -54,6 +55,18 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "not",
|
||||
kind: Keyword,
|
||||
@@ -74,18 +87,6 @@ Assessment {
|
||||
text: "(",
|
||||
kind: Punct,
|
||||
},
|
||||
Candidate {
|
||||
text: "Email",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "Name",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "id",
|
||||
kind: Identifier,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/where_expression.rs
|
||||
assertion_line: 50
|
||||
description: "input=\"delete from Things where k between \" cursor=35"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -20,18 +21,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "auto",
|
||||
kind: Identifier,
|
||||
@@ -72,6 +61,18 @@ Assessment {
|
||||
text: "ts",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
---
|
||||
source: tests/typing_surface/where_expression.rs
|
||||
assertion_line: 58
|
||||
description: "input=\"delete from Things where k in (\" cursor=31"
|
||||
expression: "& a"
|
||||
---
|
||||
@@ -20,18 +21,6 @@ Assessment {
|
||||
),
|
||||
partial_prefix: "",
|
||||
candidates: [
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "auto",
|
||||
kind: Identifier,
|
||||
@@ -72,6 +61,18 @@ Assessment {
|
||||
text: "ts",
|
||||
kind: Identifier,
|
||||
},
|
||||
Candidate {
|
||||
text: "null",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "true",
|
||||
kind: Keyword,
|
||||
},
|
||||
Candidate {
|
||||
text: "false",
|
||||
kind: Keyword,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user