kaleidawave / ezno

A JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance
https://kaleidawave.github.io/posts/introducing-ezno/
MIT License
2.3k stars 42 forks source link

Diagnostics container as a trait / callback #87

Open kaleidawave opened 7 months ago

kaleidawave commented 7 months ago

Currently all diagnostics (type checking errors, warnings, information items) are buffered into a vector which is output.

There could instead be a case where the errors are passed to a callback that immediately prints them or raises them to some process.

This could:

The ReadFromFS trait / generic parameter used throughout the checker, could be made into a more CheckingStuff trait that is custom for the checking environment (CLI, WASM project, LSP etc). A more general trait would be less code rewriting and avoid a third (unnecessary) generic parameter.