-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
markers: apply problem marker sorting based on severity, line, and column number #7313
Conversation
do we do any sortings based on the file paths? in the github issue you mentioned
so can i assume that the path-based sorting should also be supported with your change? |
I don't do any sorting at the moment for |
@elaihau there does not seem to be any sorting of files at the moment for the problems view, and it looks like we add new problems to the bottom of the view as the files are opened (with markers). This pull-request was intended to fix the issue of for a given resource, to sort it's diagnostics with a ruleset. Can we include the improvement of actual resource sorting as a different pull-request as it was not the intention of this pull-request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested in gitpod.
Worked properly given that sorting by file paths is not in the scope of this pull request.
Thank you Vincent !
I just noticed that this pr has "fixes 6572" in its description, maybe we could create a new GH issue to keep track of the file path sorting issue. |
import { Marker } from '../../common/marker'; | ||
import { Diagnostic } from '@theia/languages/lib/browser'; | ||
|
||
export namespace ProblemUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) I would better to add them as static method to ProblemTree
. Utils
always feels like it is useful to share but I don't know what is a good concept for it.
Did you test it on performance? cc @marcdumais-work do you remember how we used to test #2316 against java? I remember we managed to create like over 40000 problem markers, too bad that we did not have a rule to write down test by then. |
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>
9190d48
to
3eafd72
Compare
I could not find any noticeable degredation. I updated one of our I will try to do more performance testing with numbers if helpful. |
@vince-fugnitto it is probably fine, 3k is not enough though, i think we used to open eclipse java ls project. Initially it should report tons of error markers for different resources. |
I verified using the eclipse.jdt.ls project (which generates ~30k markers).
I timed the time it takes once |
Please see past discussions:
It is the |
From @elaihau commnet:
I agree that we should have a new issue raised and have a link in this PR or in "6572"
Unless a user can determine what the number means, either we provide a link or when hover the number, it points to its description, I don't see the purpose to display that big number, it just clutter the display unless we can refer to it by some means |
There is not necessarily more info in the output that was parsed to generate the Marker. Anyway the error codes should be familiar to developers for a given language - generally compilers will output the same, without any more context e.g. error
|
As mentioned, it is already tracked: #7318
It displays the A user can perform a search based on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
I'll merge tomorrow if there are no objections. |
What it does
Fixes #6572
The following commit updates the
markers
to be sorted based on the following rules:severity
severity
are equal, sort by lowest line numberseverity
andline number
are equal, sort by lowest column numberHow to test
Review checklist
Reminder for reviewers
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com