Skip to content
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

problems: update problem marker sorting (severity, line, column number) #6572

Closed
vince-fugnitto opened this issue Nov 18, 2019 · 7 comments · Fixed by #7313 or #9211
Closed

problems: update problem marker sorting (severity, line, column number) #6572

vince-fugnitto opened this issue Nov 18, 2019 · 7 comments · Fixed by #7313 or #9211
Labels
problems issues related to the problems widget

Comments

@vince-fugnitto
Copy link
Member

vince-fugnitto commented Nov 18, 2019

Description

Based on the following #6572 (comment), problem markers should be consistently sorted using the following guidelines:

  1. markers for a given resource are first sorted by severity
  2. if the severity are equal, sort by lowest line number
  3. if the severity and line number are equal, sort by lowest column number
  4. if all props are equal, do not perform a sort

Example:

example/a.ts
- error [typescript] "message" (1, 20)
- error [typescript] "message" (2, 10)
- error [typescript] "message" (4, 10)
- warning [typescript] "message" (1, 10)
- info [typescript] "message" (3, 10)

example/b.ts
- error [typescript] "message" (3, 6)
Original Post
Currently, _problem markers_ are sorted based on `line number + position`.

I propose that a new preference is created which controls the sorting behavior of markers present in the problems widget, by sorting based on severity + line number + position.

For example:

example/a.ts
- warning [typescript] "message" (1, 10)
- error [typescript] "message" (1, 20)
- error [typescript] "message" (2, 10)
- info [typescript] "message" (3, 10)
- error [typescript] "message" (4, 10)

Can also be sorted as:

example/a.ts
- error [typescript] "message" (1, 20)
- error [typescript] "message" (2, 10)
- error [typescript] "message" (4, 10)
- warning [typescript] "message" (1, 10)
- info [typescript] "message" (3, 10)
@vince-fugnitto vince-fugnitto added problems issues related to the problems widget proposal feature proposals (potential future features) labels Nov 18, 2019
@akosyakov
Copy link
Member

Or just do it like that always?

@vince-fugnitto
Copy link
Member Author

Or just do it like that always?

You mean as in sort by severity + line number + position always?
I guess it's up to the team, but if we want to support the default behavior present in VS Code, I thought a preference might be nice so users can choose what they'd like.

@akosyakov
Copy link
Member

if we want to support the default behavior present in VS Code,

They don't sort by severity?

@vince-fugnitto
Copy link
Member Author

if we want to support the default behavior present in VS Code,

They don't sort by severity?

I might have been mistaken this entire time 🙈.
This is the behavior I see in Theia:

Screen Shot 2019-11-19 at 8 30 43 AM

It looks like we sort by severity, but also by the source and error message.
The (line number + position) seems to be one of the last things we sort by.

@akosyakov
Copy link
Member

I actually not sure that Theia or VS Code does any sorting. It could be a responsibility of diagnostics owner. Were you able to find the code doing sorting?

@vince-fugnitto
Copy link
Member Author

I verified and VS Code performs the following sorting (as described by their test case):

  1. they sort by resources by file path
  2. they sort by severity, line and column number

@vince-fugnitto vince-fugnitto changed the title [problems] add preference to control marker sorting problems: update problem marker sorting (severity, line, column number) Mar 5, 2020
@vince-fugnitto vince-fugnitto removed the proposal feature proposals (potential future features) label Mar 5, 2020
vince-fugnitto added a commit that referenced this issue Mar 10, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Mar 11, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Mar 11, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Mar 11, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Mar 12, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Mar 18, 2020
Fixes #6572

The following commit updates the `markers` to be sorted based on the following rules:
- markers are sorted by `severity`.
- if the first step is equal, markers are sorted by `line number`.
- if the second step is equal, markers are sorted by `column number`.
- else return no change.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
JonasHelming added a commit to JonasHelming/theia that referenced this issue Mar 16, 2021
fixed eclipse-theia#6572

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
@JonasHelming
Copy link
Contributor

Sorting can jump if two markers with identical severity, line and column from different owners are shown. This is due the fact that some owner (e.g. typescript) completely clear and re add their marker. I therefore suggest to also sort by owner to prevent the jump (see screens capture)
orderproblemsview

@JonasHelming JonasHelming reopened this Mar 16, 2021
JonasHelming added a commit to JonasHelming/theia that referenced this issue Mar 17, 2021
fixed eclipse-theia#6572

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
JonasHelming added a commit to JonasHelming/theia that referenced this issue Mar 17, 2021
fixed eclipse-theia#6572

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
JonasHelming added a commit to JonasHelming/theia that referenced this issue Mar 17, 2021
Fixes: eclipse-theia#6572

The following commit adds an additional problem marker sort based on 'owner` as a fallback to 'severity', 'line number' and 'column number'.Added pmarker sorting by owner

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
JonasHelming added a commit that referenced this issue Mar 18, 2021
Fixes: #6572

The following commit adds an additional problem marker sort based on 'owner` as a fallback to 'severity', 'line number' and 'column number'.Added pmarker sorting by owner

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problems issues related to the problems widget
Projects
None yet
3 participants