mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
polish matchesAllTags (#190777)
* polish matchesAllTags * Even more polish
This commit is contained in:
parent
5d0b606ec4
commit
c90b977571
|
@ -382,7 +382,9 @@ export class SettingsTreeSettingElement extends SettingsTreeElement {
|
|||
}
|
||||
|
||||
matchesAllTags(tagFilters?: Set<string>): boolean {
|
||||
if (!tagFilters || !tagFilters.size) {
|
||||
if (!tagFilters?.size) {
|
||||
// This setting, which may have tags,
|
||||
// matches against a query with no tags.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -392,15 +394,9 @@ export class SettingsTreeSettingElement extends SettingsTreeElement {
|
|||
this.inspectSelf();
|
||||
}
|
||||
|
||||
if (this.tags) {
|
||||
let hasFilteredTag = true;
|
||||
tagFilters.forEach(tag => {
|
||||
hasFilteredTag = hasFilteredTag && this.tags!.has(tag);
|
||||
});
|
||||
return hasFilteredTag;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// Check that the filter tags are a subset of this setting's tags
|
||||
return !!this.tags?.size &&
|
||||
Array.from(tagFilters).every(tag => this.tags!.has(tag));
|
||||
}
|
||||
|
||||
matchesScope(scope: SettingsTarget, isRemote: boolean): boolean {
|
||||
|
|
Loading…
Reference in a new issue