-
Notifications
You must be signed in to change notification settings - Fork 28k
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
fix #62531 add negative text filtering to Problems #115351
Conversation
@sandy081 please review this. |
@sandy081 I think it'd be good to get this merged early in the life of 1.54 so it can get some miles on the clock 🙏 |
Sorry for the delay. I will do first thing reviewing this tomorrow. |
if (this.options.textFilter && uriMatches) { | ||
return { visibility: true, data: { type: FilterDataType.ResourceMarkers, uriMatches } }; | ||
const negate = this.options.textFilter.startsWith('!'); | ||
const textFilter = this.options.textFilter.substring(negate ? 1 : 0); |
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.
Seems like textFilter & negate options are being computed outside and everywhere. Instead I would suggest to move these semantics into FilterOptions and change textFilter
type to {text: string, negate: boolean} | undefined
.
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.
Good idea. I have pushed the changes.
if (anyMatched && negate) { | ||
return false; | ||
} else if (anyMatched || negate) { | ||
return negate ? false : { visibility: true, data: { type: FilterDataType.RelatedInformation, uriMatches: uriMatches || [], messageMatches: messageMatches || [] } }; |
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.
Is it an oversight here to return false
when negate
?
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.
@gjsjohnmurray Not sure if you have seen this comment?
@gjsjohnmurray Thanks for the changes. Merging the PR. |
That's one of the long awaited "minor issues" that comes up quite regularly. Thanks for having it done so far. Of course people will wonder about combined filters next |
@GitMensch not sure what you mean by your filter |
Sounds good. That remark was about a combined filtering in general:
(that was a help request from a co-worker some weeks ago to show all overflow warnings but filter out the ones that explicit said something about "possible overflow" [without recompiling everything]) |
When I see all problems in a huge workspace I sometimes conclude to not or only investigate two (or three or...) issues.
Is "combined filtering" (which doesn't seems to be possible yet) in the pipeline? I did not found an issue for this with "filter pane" search. |
This PR fixes #62531
If the first character of the filter field value is
!
then only problems that don't match the rest of the value will display.To test:
!
to your filter and confirm you see only the problems that the previous step had omitted.