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:
claude@clouddev1
2026-05-15 08:33:59 +00:00
parent a41400e532
commit 266b4c2ef4
11 changed files with 153 additions and 1236 deletions
+4 -7
View File
@@ -839,18 +839,15 @@ async fn refresh_schema_cache(
event_tx: &mpsc::Sender<AppEvent>,
) {
use crate::completion::SchemaCache;
use crate::dsl::ident_slot::IdentSlot;
use crate::dsl::grammar::IdentSource;
let mut cache = SchemaCache::default();
if let Ok(tables) = database.list_names_for(IdentSlot::TableName).await {
if let Ok(tables) = database.list_names_for(IdentSource::Tables).await {
cache.tables = tables;
}
if let Ok(columns) = database.list_names_for(IdentSlot::Column).await {
if let Ok(columns) = database.list_names_for(IdentSource::Columns).await {
cache.columns = columns;
}
if let Ok(rels) = database
.list_names_for(IdentSlot::RelationshipName)
.await
{
if let Ok(rels) = database.list_names_for(IdentSource::Relationships).await {
cache.relationships = rels;
}
let _ = event_tx.send(AppEvent::SchemaCacheRefreshed(cache)).await;