ezno icon indicating copy to clipboard operation
ezno copied to clipboard

Diagnostics container as a trait / callback

Open kaleidawave opened this issue 7 months ago • 0 comments

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:

  • Use references or format_args! to reduce allocation
  • Use threads. Type checking could continue while another writes to stdout
  • Reduce allocating a large vector (in the case where a codebase has A LOT of errors)

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.

kaleidawave avatar Nov 20 '23 22:11 kaleidawave