Skip to content

Commit

Permalink
recovery fix (#237474)
Browse files Browse the repository at this point in the history
* recovery fix for #236429

* fix tests

* fix tests
  • Loading branch information
sandy081 authored Jan 8, 2025
1 parent afbb64b commit 33f3b65
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export class TestConfigurationService implements IConfigurationService {
}

public inspect<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<T> {
const config = this.getValue(undefined, overrides);
const value = this.getValue(key, overrides);

return {
value: getConfigurationValue<T>(config, key),
defaultValue: getConfigurationValue<T>(config, key),
userValue: getConfigurationValue<T>(config, key),
value,
defaultValue: undefined,
userValue: value,
overrideIdentifiers: this.overrideIdentifiers.get(key)
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export class AllowedExtensionsService extends Disposable implements IAllowedExte
}

private getAllowedExtensionsValue(): AllowedExtensionsConfigValueType | undefined {
const value = this.configurationService.getValue<AllowedExtensionsConfigValueType | undefined>(AllowedExtensionsConfigKey);
const inspectValue = this.configurationService.inspect<AllowedExtensionsConfigValueType | undefined>(AllowedExtensionsConfigKey);
const value = inspectValue.policyValue ?? inspectValue.userValue ?? inspectValue.defaultValue;
if (!isObject(value) || Array.isArray(value)) {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,9 @@ suite('ExtensionsWorkbenchServiceTest', () => {
return true;
},
});
},
inspect: (key: string) => {
return {};
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -763,4 +763,13 @@ class MockInputsConfigurationService extends TestConfigurationService {
}
return configuration;
}

public override inspect<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<T> {
return {
value: undefined,
defaultValue: undefined,
userValue: undefined,
overrideIdentifiers: []
};
}
}

0 comments on commit 33f3b65

Please sign in to comment.