amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
324 stars 15 forks source link

Further editor fanciness #222

Open SquidDev opened 4 years ago

SquidDev commented 4 years ago

Features

One thing to be aware of is the complexities in mapping locations back to the typed AST. Typing and desugaring introduces additional nodes, so we need to be careful that what we point to is the correct definition.

Minor cleanup

Further notes

The compiler is currently very much structured in a fail fast manner. Resolution (and TC to a lesser extent) either succeed, or fail and throw away all information. This is obviously not ideal as far as editing goes, as you are rarely operating on a well-formed tree.

There's a couple of things we could do to improve this:

SquidDev commented 4 years ago

Now that v3.15 of the protocol has been released, it'd be worth adding support for diagnostic tags. This is used in VS Code to render unused variables and deprecated variables in specific ways.

We'll need to submit a PR to haskell-lsp in order to enable that. I put something together when the spec was a draft, but that needs finishing off and pushing.