feat: ADR-0035 4i(e) — colour DSL vs SQL completions when mixed

Building on the 4i(d) merge: tag each completion Candidate with a
ModeClass (Both/Advanced/Simple) and, in the hint UI, colour the
continuations by mode ONLY when a candidate list actually mixes modes
(a shared entry word offering both SQL and DSL forms) — Advanced →
theme.mode_advanced, Simple → theme.mode_simple, Both → the token-kind
colour. A single-mode list (the common case, e.g. deep inside a SQL
statement) keeps the token-kind colours, so the tint appears only where
it distinguishes DSL from SQL. With (d)'s Both → Advanced → Simple
block-ordering, each colour reads as one contiguous block.

Candidate gains a `mode` field (typing_surface snapshots regenerated —
uniformly `mode: Both`, no semantic change). Tests: render_candidate_line
mixed-mode colours + the single-mode-keeps-kind-colour rule. Full suite
1913 passing / 0 failing / 1 ignored; clippy clean.
This commit is contained in:
claude@clouddev1
2026-05-26 12:11:12 +00:00
parent 1afcf4ed29
commit f85261032d
132 changed files with 699 additions and 30 deletions
+4 -4
View File
@@ -1495,8 +1495,8 @@ mod tests {
inserted_range: (5, 5),
original_text: String::new(),
candidates: vec![
Candidate { text: "data".to_string(), kind: CandidateKind::Keyword },
Candidate { text: "table".to_string(), kind: CandidateKind::Keyword },
Candidate { text: "data".to_string(), kind: CandidateKind::Keyword, mode: crate::completion::ModeClass::Both },
Candidate { text: "table".to_string(), kind: CandidateKind::Keyword, mode: crate::completion::ModeClass::Both },
],
selection_idx: 1,
};
@@ -1529,8 +1529,8 @@ mod tests {
// produce — proves the memo's list is being used,
// not a recomputed one.
candidates: vec![
Candidate { text: "data".to_string(), kind: CandidateKind::Keyword },
Candidate { text: "table".to_string(), kind: CandidateKind::Keyword },
Candidate { text: "data".to_string(), kind: CandidateKind::Keyword, mode: crate::completion::ModeClass::Both },
Candidate { text: "table".to_string(), kind: CandidateKind::Keyword, mode: crate::completion::ModeClass::Both },
],
selection_idx: 1,
};