Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
matthijskooijman wants to merge 1 commit into arduino:master
base: master
Choose a base branch
Loading
from matthijskooijman:scroll-to-error

Conversation

Copy link
Collaborator

@matthijskooijman matthijskooijman commented Mar 16, 2017

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.

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 :-)

per1234 and cousteaulecommandant reacted with thumbs up emoji
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.
@matthijskooijman matthijskooijman added the in progress Work on this item is in progress label Mar 16, 2017
Copy link
Member

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)

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link

CLAassistant commented Apr 9, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
in progress Work on this item is in progress
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /