0verEngineer / InlineProblems

Plugin to show problems inside the text editor for IDEs based on the IntelliJ Platform
GNU General Public License v3.0
61 stars 7 forks source link

Feature Request: setting to left-prioritise errors #21

Closed dominicpalmer closed 1 year ago

dominicpalmer commented 1 year ago

Issue

When a line contains more than one problem, the resulting labels aren't ordered by problem severity. And moreover, the labels aren't always ordered by where on the line the problem originates, either.

For example, I'd expect these two lines to have the errors (red) displayed furthest left. Only the first line has this, despite the problems being ordered the same:

image

Suggestions

Possible approaches for when a line contains multiple problems of different severities:

i) Display all problems, but first order by problem severity and then by problem location on the line. This gives the user a list of 'things' to work through, prioritised by importance. ii) Only ever display problems of the highest severity for a given line. Only once the highest severity problems are resolved do the next highest severity problems get displayed. FYI this is how similar plugins for other editors work. Here's Visual Studio:

inlineproblems

0verEngineer commented 1 year ago

Hey, thanks for the detailed bug report, i have this problem already in my list as well.

The reason why this is not implemented yet is that we have multiple ways to get the problems and not all of them behave the same.

To order them we will need some special handling when adding problems, i hope this will be performant with all problem collectors.

It is easy to implement for the HighlightProblemListener and for the ManualScanner as they update from a complete list of new problems on each change. The MarkupModelProblemListener instead works with change events and updates one problem for each event, so thats not that easy to do.

I would like to implement both of your suggestions, with a toggle to switch between them.

I try to do this for the next release as it bothers me as well.

0verEngineer commented 1 year ago

https://github.com/0verEngineer/InlineProblems/pull/22

0verEngineer commented 1 year ago

I closed the other PR because my implementation was bad.

https://github.com/0verEngineer/InlineProblems/pull/23

dominicpalmer commented 1 year ago

Awesome. Thank you for this change 👍