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

add options for jumping to next/previous problem #135736

Merged
merged 4 commits into from
Nov 1, 2021
Merged

add options for jumping to next/previous problem #135736

merged 4 commits into from
Nov 1, 2021

Conversation

pohzipohzi
Copy link
Contributor

@pohzipohzi pohzipohzi commented Oct 24, 2021

This PR fixes #135249

Default behaviour:

before

After setting "problems.compareOrder": "position":

after

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this.

Tho, we cannot change the behavior just like that for all our users. Traversing diagnostics by severity (error, warning, info, hint) was a conscious decision. Please understand that users like the current behavior just like you dislike it. Therefore, this needs to be behind a user-setting.

@ghost
Copy link

ghost commented Oct 26, 2021

CLA assistant check
All CLA requirements met.

@pohzipohzi pohzipohzi changed the title jump to next/previous problem by diagnostic start position add options for jumping to next/previous problem Oct 26, 2021
@pohzipohzi
Copy link
Contributor Author

@jrieken thank you for the feedback. I've updated to the PR to make the sort order configurable, how does it look? I'll try to update the documentation accordingly if this works

},
'problems.sortOrder': {
'description': 'TODO',
'type': 'array',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use an enum because there is a fixed option of picks, take this as a sample:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what enum values would you propose, looking at the rest of the comments perhaps just 2: severityFirst and startPositionFirst?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just severity and position is enough

) {
if (URI.isUri(resourceFilter)) {
this._resourceFilter = uri => uri.toString() === resourceFilter.toString();
} else if (resourceFilter) {
this._resourceFilter = resourceFilter;
}

const sortOrder = this._configService.getValue<string[]>('problems.sortOrder');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be retrieving a single string (not array) which is one of the enum values.

}
switch (sortOrder[i]) {
case 'resource':
res = compare(a.resource.toString(), b.resource.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting by resource cannot be configurable and must always be checked first. The resource comparing is done for notebook cells (which is multiple resources/document within a single logical notebook editor) and you don't want F8 to jump back and forth between cells.

res = Range.compareRangesUsingStarts(a, b);
break;
case 'ends':
res = Range.compareRangesUsingEnds(a, b);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does comparing by ends really make sense?

@jrieken jrieken added this to the November 2021 milestone Oct 27, 2021
@pohzipohzi
Copy link
Contributor Author

Made the enum changes, I'll fill in the docs if this looks alright 🙂

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is looking good. Approving but since we are currently in endgame I can only merge in a few days

@jrieken jrieken merged commit ad19e08 into microsoft:main Nov 1, 2021
@pohzipohzi pohzipohzi deleted the diag branch November 1, 2021 08:37
@ArturoDent
Copy link

I am seeing two severity options listed for the setting - one without a description.

compareOrder

@jrieken
Copy link
Member

jrieken commented Nov 15, 2021

Thanks for pointing that out. The JSON schema default value didn't match the enum set. I have pushed a fix

jrieken added a commit that referenced this pull request Nov 15, 2021
benoitf added a commit to benoitf/che-code--old that referenced this pull request Nov 15, 2021
466d041 update distro
ccdd1bf update distro
5be3575 Remove unnecessary regexp escape (for #137166)
bacf6ed smoke - properly create screenshots and stop instances (#137220)
c33965a Fix terminal dnd feedback
ddd2f59 Fix terminal detach session
5243c40 #136424 add to proposed api
f76b133 Don't wait for 4s orphan check for just revived processes
4a7cd94 tweak for microsoft/vscode#135736 (comment)

git-subtree-dir: code
git-subtree-split: 466d041
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go to next problem sorted by diagnostic start position
3 participants