diff --git a/src/vs/platform/configuration/test/common/testConfigurationService.ts b/src/vs/platform/configuration/test/common/testConfigurationService.ts index c2e63fa4dfb92..13d6c0b622aa7 100644 --- a/src/vs/platform/configuration/test/common/testConfigurationService.ts +++ b/src/vs/platform/configuration/test/common/testConfigurationService.ts @@ -64,12 +64,12 @@ export class TestConfigurationService implements IConfigurationService { } public inspect(key: string, overrides?: IConfigurationOverrides): IConfigurationValue { - const config = this.getValue(undefined, overrides); + const value = this.getValue(key, overrides); return { - value: getConfigurationValue(config, key), - defaultValue: getConfigurationValue(config, key), - userValue: getConfigurationValue(config, key), + value, + defaultValue: undefined, + userValue: value, overrideIdentifiers: this.overrideIdentifiers.get(key) }; } diff --git a/src/vs/platform/extensionManagement/common/allowedExtensionsService.ts b/src/vs/platform/extensionManagement/common/allowedExtensionsService.ts index 0d00bc2bfeb34..7a2892fd098fb 100644 --- a/src/vs/platform/extensionManagement/common/allowedExtensionsService.ts +++ b/src/vs/platform/extensionManagement/common/allowedExtensionsService.ts @@ -54,7 +54,8 @@ export class AllowedExtensionsService extends Disposable implements IAllowedExte } private getAllowedExtensionsValue(): AllowedExtensionsConfigValueType | undefined { - const value = this.configurationService.getValue(AllowedExtensionsConfigKey); + const inspectValue = this.configurationService.inspect(AllowedExtensionsConfigKey); + const value = inspectValue.policyValue ?? inspectValue.userValue ?? inspectValue.defaultValue; if (!isObject(value) || Array.isArray(value)) { return undefined; } diff --git a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsWorkbenchService.test.ts index 03fd27f96b8ff..c49ca4dfa186d 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsWorkbenchService.test.ts @@ -1640,6 +1640,9 @@ suite('ExtensionsWorkbenchServiceTest', () => { return true; }, }); + }, + inspect: (key: string) => { + return {}; } }); } diff --git a/src/vs/workbench/services/configurationResolver/test/electron-sandbox/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/electron-sandbox/configurationResolverService.test.ts index 9140cb41d9e30..804966dd7ec92 100644 --- a/src/vs/workbench/services/configurationResolver/test/electron-sandbox/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/electron-sandbox/configurationResolverService.test.ts @@ -16,7 +16,7 @@ import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/tes import { Selection } from '../../../../../editor/common/core/selection.js'; import { EditorType } from '../../../../../editor/common/editorCommon.js'; import { ICommandService } from '../../../../../platform/commands/common/commands.js'; -import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js'; +import { IConfigurationOverrides, IConfigurationService, IConfigurationValue } from '../../../../../platform/configuration/common/configuration.js'; import { TestConfigurationService } from '../../../../../platform/configuration/test/common/testConfigurationService.js'; import { IExtensionDescription } from '../../../../../platform/extensions/common/extensions.js'; import { IFormatterChangeEvent, ILabelService, ResourceLabelFormatter, Verbosity } from '../../../../../platform/label/common/label.js'; @@ -763,4 +763,13 @@ class MockInputsConfigurationService extends TestConfigurationService { } return configuration; } + + public override inspect(key: string, overrides?: IConfigurationOverrides): IConfigurationValue { + return { + value: undefined, + defaultValue: undefined, + userValue: undefined, + overrideIdentifiers: [] + }; + } }