hint: pre-submit-diagnostic route + diagnostic.* tier-3 blocks (deferred from ADR-0053) #38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Deferred from H2 / ADR-0053 (Phase C): the pre-submit-diagnostic
route for the contextual
hint— F1 on live input, when the cursorsits on a typing-time diagnostic, rendering that diagnostic's tier-3
hint.err.<class>block — plus the ~33diagnostic.*tier-3 blocksthemselves.
Why deferred
ADR-0053 D2 specified that the F1 live-input path reads the current
under-cursor diagnostic and renders its
hint.err.<class>block. DuringPhase C we found
Diagnostic(src/dsl/walker/outcome.rs:194) carriesonly
severity/span/message(the already-rendered text) — notits class key. So a live diagnostic can't be mapped to its
hint.err.<class>stem.Wiring the route needs a
class(ormessage_key) field added toDiagnostic, threaded through every diagnostic-creation site acrossthe walker and validators — a broad mechanism change, plausibly larger
than the rest of Phase C, for the most marginal teaching value:
panel shows the diagnostic message and the validity indicator
(ADR-0027) flags it while you type.
present it shows the command block (e.g. insert's what/example/
concept), and tier-2 shows the diagnostic. No hole.
diagnostic.*classes overlap runtime error classes alreadycovered (
type_mismatch,unknown_table↔not_found, arity ↔invalid_value), so distinct content would largely duplicate them.So v1 ships command-form hints + the 9 runtime error-class hints
(comprehensive for those); diagnostics are deferred here.
Scope to decide (when picked up)
class: Option<&'static str>(ormessage_key) toDiagnostic; populate it at every creation site.exists, render
hint.err.<class>for it (priority vs the commandblock — likely diagnostic wins when present).
hint.err.<diagnostic_class>blocks, or reuse the runtime error-class blocks where a class has a
twin (type_mismatch, not_found, invalid_value, …) and only author
the genuinely-new ones (arity variants, ambiguous_column,
duplicate_cte, alias/projection issues, …).
diagnostic class resolves to a hint block.
Notes
doesn't lock it out. Likely its own small ADR amendment.