scastie icon indicating copy to clipboard operation
scastie copied to clipboard

consider a different approach for displaying error messages

Open tpolecat opened this issue 7 years ago • 3 comments

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

image

tpolecat avatar May 30 '17 04:05 tpolecat

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?

MasseGuillaume avatar May 30 '17 09:05 MasseGuillaume

how about this:

  1. highlight the line with error/warning via background
  2. add a tiny pointer below the line for exact position
  3. try to maintain positions on basic code edits like adding a line or typing in the line, dismiss all highlighting with esc
  4. add bidirectional link between current cursor position and highlighted error in sbt output

OlegYch avatar Jun 13 '17 19:06 OlegYch

Maybe a friendlier way to show the errors would be to use the lining features of CodeMirror: https://codemirror.net/examples/lint/

julienrf avatar Aug 02 '22 11:08 julienrf

I believe this issue has been solved by #628. Please re-open it if you would like to change the way errors are displayed.

julienrf avatar Nov 15 '22 16:11 julienrf