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
only show warnings if no errors OR sublime_linter_goto_error ignores warnings if there are errors #1844
Comments
Actually I find both ideas interesting.. We don't have neither. We have for example
as a global setting which will then not draw underlines, marked regions while editing. But you can still "goto" them as there are also still visible in the error panel. (And summed in the status bar.) Of course it is a bit confusing if you have a lot of highlighted areas in the buffer (for example warnings) but you can't go to them. If you instead hide them, you probably want to inform the users: btw there are also some warnings currently hidden. Also should this be global switch or one per linter? That's not trivial to design. You can try to make implementations to see how it feels. Or discuss the idea in more depth here. I moved the issue to the "SublimeLinter" core repo as that's the place where it would get implemented anyway. |
Yea, I agree with you about not wanting to hide the warnings so that the user can know there are warnings. And about the confusion of seeing the warning but not being able to navigate to them. So I was thinking the ideal implementation would be to have an argument that can be passed to "sublime_linter_goto_error", eg: skip_warnings_if_errors or whatever if the skip_warnings_if_errors flag is True, the goto command would check the "mistake" list for errors and goto the next one. and if there are no errors, then resume the default behaviour. |
That's a way to make it backwards compatible but maybe doesn't solve the ux problem. For example, I usually don't want two different key bindings to jump around. And it is hard to imagine that I never want to jump to the exact next highlighted area which could be an error, a warning, a note. But maybe try that implementation first; it's simple to do and we can see how it feels. |
I understand what you mean, but since they are 2 different uses, with this new one being more restrictive than the default. The only way is to either have 2 shortcuts if you want both uses, or if you don't want to have 2 shortcuts you'd have to pick the one you prefer I created a fork to test the implementation ta946@a6a6c37 Luckily it was very easy, filter the list for errors only, If there are any errors, replace the original list with the errors only list (without modifying the original list) and continue with the goto logic. just need to add a new keyboard shortcut like so |
Haha, that's indeed a trivial patch. Let's see how it feels. |
I want to easily focus on fixing any errors in my code by calling "sublime_linter_goto_error" and check if there are any errors.
But the navigation is just in chronological order rather than priority, so I would have to go through warnings to see if there are any errors.
Is there a command in flake8 or SublimeLinter to hide warnings if there are any errors so they are more obvious and easier to find and navigate to?
Alternatively, which would be better, is there an option in SublimeLinter for "sublime_linter_goto_error" to only go to errors if there are any errors, and only goto warnings if there are no errors?
The text was updated successfully, but these errors were encountered: