asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Diagnostics Consumer for Language Servers #77

Open asoffer opened 2 years ago

asoffer commented 2 years ago

Currently each diagnostic is its own type and required to have 3 things:

Naming aside, The idea here is that we want a somewhat universal format for diagnostics so they can be passed to different diagnostic consumption mechanisms. Diagnostics printed to a terminal should likely be formatted differently than those streamed to a webserver. In essence, DiagnosticMessage is intended to be a relatively simple "document format" that can by stylized differently in different contexts.

One such use case we have not yet designed for is having a language server pass information to an editor. It seems mostly straightforward to have a diagnostic consumer that extracts just the source ranges and diagnostic name information for this purpose. I suspect there's a lot that can be improved about the API considering this use-case that we haven't looked at before.

perimosocordiae commented 2 years ago

This is a prerequisite for gh-48.