From 49b0477399a5f9e83e5c1867e0e5b0d70ddc9ebd Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Thu, 11 Jun 2020 20:38:58 +0100 Subject: [PATCH] fix #99854 make 'Edit in settings.json' add the default for an undefined object-type setting --- .../services/preferences/browser/preferencesService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 11284ef94c2a6..aaf4fb8720b37 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -614,7 +614,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic const type = schema ? schema.type : 'object' /* Override Identifier */; let setting = settingsModel.getPreference(settingKey); if (!setting) { - const defaultValue = type === 'array' ? this.configurationService.inspect(settingKey).defaultValue : getDefaultValue(type); + const defaultValue = (type === 'object' || type === 'array') ? this.configurationService.inspect(settingKey).defaultValue : getDefaultValue(type); if (defaultValue !== undefined) { const key = settingsModel instanceof WorkspaceConfigurationEditorModel ? ['settings', settingKey] : [settingKey]; await this.jsonEditingService.write(settingsModel.uri!, [{ path: key, value: defaultValue }], false);