Here's what it looks like when the input has a syntax error:
and here's what it looks like when the syntax is valid, but we can't produce output for some reason:
These errors aren't friendly at all, and need to be cleaned up. A codeframe would be nice for parser errors, and when we can't generate output, a codeframe and a better explanation would be nice, as well as a link to our issue tracker š
Spec
For parser error, output a detailed syntax error and codeframe
For compiler errors (we can't generate output), output a codeframe and why we can't generate the code, maybe a link to our issue tracker as well
Implementation details
This should happen at the JS level, not the compiler - somewhere in the CLI code. Something like babel-code-frame would do most of what we want for us as far as output goes. There might be some Reason code necessary to extract better errors from the Flow parser, possibly in retyped_node.re or the main JS interface index.js.
As always, I'm available to help in the ReasonML Discord or on here!
Here's what it looks like when the input has a syntax error:
and here's what it looks like when the syntax is valid, but we can't produce output for some reason:
These errors aren't friendly at all, and need to be cleaned up. A codeframe would be nice for parser errors, and when we can't generate output, a codeframe and a better explanation would be nice, as well as a link to our issue tracker š
Spec
Implementation details
This should happen at the JS level, not the compiler - somewhere in the CLI code. Something like babel-code-frame would do most of what we want for us as far as output goes. There might be some Reason code necessary to extract better errors from the Flow parser, possibly in retyped_node.re or the main JS interface index.js.
As always, I'm available to help in the ReasonML Discord or on here!