Skip to content

Commit ff1e16e

Browse files
committed
Fix #136009
1 parent bc4e05c commit ff1e16e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,18 @@ function isObjectSetting({
596596
return false;
597597
}
598598

599-
// object additional properties allow it to have any shape
600-
if (objectAdditionalProperties === true || objectAdditionalProperties === undefined) {
599+
// objectAdditionalProperties allow the setting to have any shape,
600+
// but if there's a pattern property that handles everything, then every
601+
// property will match that patternProperty, so we don't need to look at
602+
// the value of objectAdditionalProperties in that case.
603+
if ((objectAdditionalProperties === true || objectAdditionalProperties === undefined)
604+
&& !Object.keys(objectPatternProperties ?? {}).includes('.*')) {
601605
return false;
602606
}
603607

604608
const schemas = [...Object.values(objectProperties ?? {}), ...Object.values(objectPatternProperties ?? {})];
605609

606-
if (typeof objectAdditionalProperties === 'object') {
610+
if (objectAdditionalProperties && typeof objectAdditionalProperties === 'object') {
607611
schemas.push(objectAdditionalProperties);
608612
}
609613

0 commit comments

Comments
 (0)