Skip to content

Should jump to first error even when there are warnings #199

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

Closed
Boscop opened this issue Aug 18, 2017 · 10 comments · Fixed by #207
Closed

Should jump to first error even when there are warnings #199

Boscop opened this issue Aug 18, 2017 · 10 comments · Fixed by #207

Comments

@Boscop
Copy link

Boscop commented Aug 18, 2017

When I get some warnings and some errors during a build and I press F4, it should jump to the first error (and then step from there).
Currently it jumps to the first warning which is often something trivial like unused import.
This behavior is annoying, I want to fix the errors first because they have higher priority...

(IIRC it used to be the case that F4 jumps to the first error in the past, but maybe I remember wrong.)

@ehuss
Copy link

ehuss commented Aug 18, 2017

You're right. I'll look into it, thanks!

@Boscop
Copy link
Author

Boscop commented Aug 18, 2017

Thanks.
Also, it doesn't jump to the current error's description in the error output anymore when I step through errors with F4.
Btw, it doesn't use the error message format that contains code anymore. Is this a bug or intended? Every error just has one line now...

@ehuss
Copy link

ehuss commented Aug 18, 2017

That is intended, at least for now. The reason is that it now uses the JSON output from the compiler to extract the information so that it can show inline phantoms. The compiler cannot currently output both JSON and text. There is some discussion going on about refactoring and extracting the code that is responsible for rendering the text, but I think it will be a long ways off before that is ready.

@Boscop
Copy link
Author

Boscop commented Aug 18, 2017

The problem is, often the inline error doesn't fit into the width of my sublime window (especially with deeply indented code) when I have two sublime windows side by side which is most of the time, then the inline error is cut off/unreadable and I have to rely on the error output window.
So it would be really helpful to have both again!

@ehuss
Copy link

ehuss commented Aug 18, 2017

I've been thinking about that, too. What do you think if the inline message was displayed all the way to the left, instead of aligned with the column of where the error appears? Like this:

image

I think this would make it more readable in the common case, but has the drawback that if the error region is far to the right, then F4 will horizontally scroll past the message.

Another thing I've been considering is word-wrapping long messages. There are some cases where rust can spit out some very long messages. However, this has the drawback that the message may include a suggested code replacement, and it may display invalid code if word-wrapped incorrectly.

@Boscop
Copy link
Author

Boscop commented Aug 18, 2017

I think displaying the error message all the way to the left is a better solution than word wrapping.
Why would this happen: "if the error region is far to the right, then F4 will horizontally scroll past the message"?

@ehuss
Copy link

ehuss commented Aug 18, 2017

Why would this happen

If you have a really long line, the message will appear far to the left of the highlighted region, like this:

image

Unfortunately Sublime does not offer much control over the placement, so I think this problem will occur one way or another.

@Boscop
Copy link
Author

Boscop commented Aug 18, 2017

Ah, I always have wordwrapping turned on for code. No horizontal scrolling.

@Boscop
Copy link
Author

Boscop commented Aug 19, 2017

Can't the inline error be always aligned to the left of the viewport (regardless of horizontal scroll pos)?

@ehuss
Copy link

ehuss commented Aug 20, 2017

Can't the inline error be always aligned to the left of the viewport (regardless of horizontal scroll pos)?

Not that I know of. Sublime only allows you to place it directly below a specific column, or inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants