From ff1e16eebb93af79fd6d7af1356c4003a120c563 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Thu, 28 Oct 2021 14:41:48 -0700 Subject: [PATCH] Fix #136009 --- .../contrib/preferences/browser/settingsTreeModels.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts index b4aafa2d75305..f699cb4d5dc62 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts @@ -596,14 +596,18 @@ function isObjectSetting({ return false; } - // object additional properties allow it to have any shape - if (objectAdditionalProperties === true || objectAdditionalProperties === undefined) { + // objectAdditionalProperties allow the setting to have any shape, + // but if there's a pattern property that handles everything, then every + // property will match that patternProperty, so we don't need to look at + // the value of objectAdditionalProperties in that case. + if ((objectAdditionalProperties === true || objectAdditionalProperties === undefined) + && !Object.keys(objectPatternProperties ?? {}).includes('.*')) { return false; } const schemas = [...Object.values(objectProperties ?? {}), ...Object.values(objectPatternProperties ?? {})]; - if (typeof objectAdditionalProperties === 'object') { + if (objectAdditionalProperties && typeof objectAdditionalProperties === 'object') { schemas.push(objectAdditionalProperties); }