Skip to content

add options for jumping to next/previous problem - #135736

Merged
Johannes Rieken (jrieken) merged 4 commits into
microsoft:mainfrom
pohzipohzi:diag
Nov 1, 2021
Merged

Johannes Rieken (jrieken) merged 4 commits into
microsoft:mainfrom
pohzipohzi:diag

Conversation

@pohzipohzi

@pohzipohzi Zi How Poh (pohzipohzi) commented Oct 24, 2021 •

Copy link
Copy Markdown
Contributor

This PR fixes #135249

Default behaviour:

before

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

after

@jrieken Johannes Rieken (jrieken) left a comment

Copy link
Copy Markdown
Contributor

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

Deleted user (ghost) commented Oct 26, 2021 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@pohzipohzi Zi How Poh (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
Copy Markdown
Contributor Author

Johannes Rieken (@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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

this._resourceFilter = resourceFilter;
}

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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?

@pohzipohzi

Copy link
Copy Markdown
Contributor Author

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

@jrieken Johannes Rieken (jrieken) left a comment

Copy link
Copy Markdown
Contributor

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
Johannes Rieken (jrieken) merged commit ad19e08 into microsoft:main Nov 1, 2021
@ArturoDent

Copy link
Copy Markdown

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

compareOrder

@jrieken

Copy link
Copy Markdown
Contributor

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

Johannes Rieken (jrieken) added a commit that referenced this pull request Nov 15, 2021
Florent BENOIT (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