-
-
Notifications
You must be signed in to change notification settings - Fork 7k
During compilation, scroll the console to the first error #6081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
While adding messages to the console, this keeps track of the position of the first bit of stderr output. Then, whenever `EditorConsole.scrollDown()` is called, the scroll position is changed so that the line above the first error line is the first one in the console. If no errors are printed yet, the console scrolls down as before. To know what messages are coming from stderr, the ConsoleOutputStream that generated the message is passed to `EditorConsole.insertString()`, though this might not be the best solution for this.
The intention looks very good, but it seems that the console doesn't scroll anymore if there is no error but only warnings. This probably happens because everything from stderr is interpreted as en error (I have lots of warnings about broken libs etc at the very beginning of the compilation output) |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6081-BUILD-666-linux32.tar.xz ℹ️ The |
Yeah, that's a tricky thing. Currently, the error regex matching happens in a completely separate part of the code, which I couldn't easily connect to the scrolling code. Also, I'm not sure if skipping warnings is really wanted, especial compiler warnings are usually relevant. |
This also interacts badly with avrdude uploading, since that outputs all of its output on stderr, so when compilation is successful, it sticks around the top of the avrdude output without scrolling on to the progress bar. To properly implement this, I think arduino-builder should output more structured info segmenting the stdout and stderr output per command run, and communicating the first failed command, so the IDE can scroll to the output of that failed command, or something like that. On additional problem is that if you manually scroll down, the current code continues to scroll back up until compilation is complete. |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6081-BUILD-724-linux32.tar.xz ℹ️ The |
While adding messages to the console, this keeps track of the position
of the first bit of stderr output. Then, whenever
EditorConsole.scrollDown()
is called, the scroll position is changedso that the line above the first error line is the first one in the
console. If no errors are printed yet, the console scrolls down as
before.
To know what messages are coming from stderr, the ConsoleOutputStream
that generated the message is passed to
EditorConsole.insertString()
,though this might not be the best solution for this.
This PR is still a bit of proof-of-concept, especially the extra argument to
insertString()
doesn't sound like the perfect solution yet. Perhaps the console code should be refactored to be a bit simpler in the first place. But I needed this myself (it will be saving me a lot of time in my current work), so might as well put it up for discussion :-)