Improve Error Messages and Diagnostics
Priority
P2 (Medium) - Developer experience
Labels
dx
error-handling
diagnostics
P2
Estimated Effort
2 weeks
Description
Create rich, helpful compiler diagnostics using the ariadne crate. Good error messages are critical for developer experience.
Current State
Location: core/src/report.rs
Error reporting module exists but has todo!() placeholder and is underutilized throughout the codebase.
TODO References
Examples of Good Error Messages
Current (Bad)
Error: Failed to compile schema
Desired (Good)
error: undefined type `Uesr`
┌─ example.ids:5:12
│
5 │ user: Uesr
│ ^^^^ not found in this scope
│
= help: did you mean `User`?
Acceptance Criteria
Tasks
Infrastructure
Error Categories
Enhancements
Documentation
Example Implementation
use ariadne::{Report, ReportKind, Label, Source};
Report::build(ReportKind::Error, source_id, span.start)
.with_message("undefined type")
.with_label(
Label::new((source_id, span))
.with_message("not found in this scope")
.with_color(Color::Red)
)
.with_help("did you mean `User`?")
.finish()
.print((source_id, Source::from(source_code)))
Dependencies
Blocks
None
Improve Error Messages and Diagnostics
Priority
P2 (Medium) - Developer experience
Labels
dxerror-handlingdiagnosticsP2Estimated Effort
2 weeks
Description
Create rich, helpful compiler diagnostics using the
ariadnecrate. Good error messages are critical for developer experience.Current State
Location:
core/src/report.rsError reporting module exists but has
todo!()placeholder and is underutilized throughout the codebase.TODO References
report.rs:53-todo!()Examples of Good Error Messages
Current (Bad)
Desired (Good)
Acceptance Criteria
ariadnefor:Tasks
Infrastructure
Spantracking to all AST nodesariadnefor renderingError Categories
Enhancements
ariadne's auto-color feature)Documentation
Example Implementation
Dependencies
Blocks
None