ADR-0024 Phase F (full) step 3: delete legacy parser modules
Removes the last consumers of `dsl::lexer`, `dsl::keyword`, and
`dsl::ident_slot`, then deletes the modules.
- `Theme::token_color(&TokenKind)` deleted along with its test;
`Theme::highlight_class_color(HighlightClass)` is the sole
highlight-colour mapper (the walker's `per_byte_class` feeds
it directly).
- `IdentSource` (`dsl::grammar`) absorbs the schema-list /
expected-label / round-trip semantics that previously lived
on `IdentSlot`. Adds `completes_from_schema`, `expected_label`,
and `from_expected_label` methods. The walker's
`Expectation::Ident { source }` and the schema-lookup request
on the database worker now share one enum.
- `SchemaCache::for_slot(IdentSlot)` → `for_source(IdentSource)`.
- `Database::list_names_for` and the `Request::ListNamesFor`
worker variant take `IdentSource`. Internal tables and column
/ relationship lookups dispatch on the same enum.
- `InvalidIdent.slot: IdentSlot` → `InvalidIdent.source: IdentSource`.
The `invalid_ident_at_cursor` rendering branch in
`input_render.rs::ambient_hint` updates accordingly.
- Completion's keyword filter (`Keyword::from_word`) becomes
"backticked items whose payload is all ASCII alphabetic" —
punct and digit literals still surface through their own
candidate sources (composite-literal, flag, schema-ident);
the alphabetic filter excludes them from the keyword bucket.
- `friendly::keys::tests::keyword_and_punct_have_complete_token_vocabulary`
is dropped. It cross-checked `Keyword::ALL` / `Punct::ALL`
against catalog entries; both enums are gone. The
`parse.token.keyword.*` / `parse.token.punct.*` catalog
entries themselves survive for one more commit (catalog
cleanup, ADR-0024 §cleanup-pass); the
`keys_validate_against_catalog` test still pins them.
- Modules deleted: `src/dsl/lexer.rs`, `src/dsl/keyword.rs`,
`src/dsl/ident_slot.rs`.
Tests: 806 passing, 0 failing, 1 ignored. The drop from 852
reflects the removed module-internal tests (~32 lexer, 7
keyword, 4 ident_slot, 1 theme token_color, 1 friendly keys
keyword/punct), and is the expected outcome.
Clippy clean with `nursery` lints + `-D warnings`.
This commit is contained in:
+10
-9
@@ -210,15 +210,16 @@ pub fn ambient_hint(
|
||||
// the typed prefix matches nothing in the schema. (Stage
|
||||
// 8e / the user's #5.)
|
||||
if let Some(inv) = crate::completion::invalid_ident_at_cursor(input, cursor, cache) {
|
||||
let kind = match inv.slot {
|
||||
crate::dsl::ident_slot::IdentSlot::TableName => "table",
|
||||
crate::dsl::ident_slot::IdentSlot::Column => "column",
|
||||
crate::dsl::ident_slot::IdentSlot::RelationshipName => "relationship",
|
||||
// `NewName` is filtered out by `invalid_ident_at_cursor`
|
||||
// (it only fires for known-set slots), so this arm
|
||||
// is unreachable in practice; render a neutral
|
||||
// fallback rather than panic.
|
||||
crate::dsl::ident_slot::IdentSlot::NewName => "identifier",
|
||||
let kind = match inv.source {
|
||||
crate::dsl::grammar::IdentSource::Tables => "table",
|
||||
crate::dsl::grammar::IdentSource::Columns => "column",
|
||||
crate::dsl::grammar::IdentSource::Relationships => "relationship",
|
||||
// `NewName`, `Types`, `Free` are filtered out by
|
||||
// `invalid_ident_at_cursor` (it only fires for
|
||||
// known-set sources via `completes_from_schema`), so
|
||||
// these arms are unreachable in practice — render a
|
||||
// neutral fallback rather than panic.
|
||||
_ => "identifier",
|
||||
};
|
||||
return Some(AmbientHint::Prose(crate::t!(
|
||||
"hint.ambient_invalid_ident",
|
||||
|
||||
Reference in New Issue
Block a user