scastie
scastie copied to clipboard
consider a different approach for displaying error messages
Inline error messages split the code up, which is disorienting, hard to read and very hard to edit. Their location seems approximate (sometimes the error is above, sometimes below) and character offsets are not indicated. I can clear the errors to edit (which is disorienting again), but by the time I fix one I have forgotten the others and have to recompile and go through the cycle again. So I think something less invasive might work better. I suggest marking errors in the gutter and maybe highlighting the line and offset somehow, then listing detailed messages in a separate view, like Eclipse and IntelliJ do.
PS - here is an example of the error message appearing above the error
Thanks for reporting this issue. UI is complex, it's good to have your feedback on this.
Let's split this issue into various concerns:
- [ ] how the errors are displayed (inlined vs traditionnal ide: gutter + squiggly lines + error list view)
- [ ] how can we improve the position of errors (above vs bellow)
- [ ] how to keep track of errors (clearing (with esc) remove errors)
Does that make sense?
how about this:
- highlight the line with error/warning via background
- add a tiny pointer below the line for exact position
- try to maintain positions on basic code edits like adding a line or typing in the line, dismiss all highlighting with
esc
- add bidirectional link between current cursor position and highlighted error in sbt output
Maybe a friendlier way to show the errors would be to use the lining features of CodeMirror: https://codemirror.net/examples/lint/
I believe this issue has been solved by #628. Please re-open it if you would like to change the way errors are displayed.