Skip to content

Commit d887bdb

Browse files
authored
This reverts commit 6043ad1.
1 parent fde9701 commit d887bdb

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

src/vs/platform/configuration/common/configurationModels.ts

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ export class ConfigurationModel implements IConfigurationModel {
296296
}
297297

298298
export interface ConfigurationParseOptions {
299-
skipUnregistered?: boolean;
300299
scopes?: ConfigurationScope[];
301300
skipRestricted?: boolean;
302301
include?: string[];
@@ -429,10 +428,14 @@ export class ConfigurationModelParser {
429428
restricted.push(...result.restricted);
430429
} else {
431430
const propertySchema = configurationProperties[key];
431+
const scope = propertySchema ? typeof propertySchema.scope !== 'undefined' ? propertySchema.scope : ConfigurationScope.WINDOW : undefined;
432432
if (propertySchema?.restricted) {
433433
restricted.push(key);
434434
}
435-
if (this.shouldInclude(key, propertySchema, options)) {
435+
if (!options.exclude?.includes(key) /* Check exclude */
436+
&& (options.include?.includes(key) /* Check include */
437+
|| ((scope === undefined || options.scopes === undefined || options.scopes.includes(scope)) /* Check scopes */
438+
&& !(options.skipRestricted && propertySchema?.restricted)))) /* Check restricted */ {
436439
raw[key] = properties[key];
437440
} else {
438441
hasExcludedProperties = true;
@@ -442,31 +445,6 @@ export class ConfigurationModelParser {
442445
return { raw, restricted, hasExcludedProperties };
443446
}
444447

445-
private shouldInclude(key: string, propertySchema: IConfigurationPropertySchema | undefined, options: ConfigurationParseOptions): boolean {
446-
if (options.exclude?.includes(key)) {
447-
return false;
448-
}
449-
450-
if (options.include?.includes(key)) {
451-
return true;
452-
}
453-
454-
if (options.skipRestricted && propertySchema?.restricted) {
455-
return false;
456-
}
457-
458-
if (options.skipUnregistered && !propertySchema) {
459-
return false;
460-
}
461-
462-
const scope = propertySchema ? typeof propertySchema.scope !== 'undefined' ? propertySchema.scope : ConfigurationScope.WINDOW : undefined;
463-
if (scope === undefined || options.scopes === undefined) {
464-
return true;
465-
}
466-
467-
return options.scopes.includes(scope);
468-
}
469-
470448
private toOverrides(raw: any, conflictReporter: (message: string) => void): IOverrides[] {
471449
const overrides: IOverrides[] = [];
472450
for (const key of Object.keys(raw)) {

src/vs/workbench/services/configuration/browser/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class ApplicationConfiguration extends UserSettings {
133133
uriIdentityService: IUriIdentityService,
134134
logService: ILogService,
135135
) {
136-
super(userDataProfilesService.defaultProfile.settingsResource, { scopes: [ConfigurationScope.APPLICATION], skipUnregistered: true }, uriIdentityService.extUri, fileService, logService);
136+
super(userDataProfilesService.defaultProfile.settingsResource, { scopes: [ConfigurationScope.APPLICATION] }, uriIdentityService.extUri, fileService, logService);
137137
this._register(this.onDidChange(() => this.reloadConfigurationScheduler.schedule()));
138138
this.reloadConfigurationScheduler = this._register(new RunOnceScheduler(() => this.loadConfiguration().then(configurationModel => this._onDidChangeConfiguration.fire(configurationModel)), 50));
139139
}

src/vs/workbench/services/configuration/test/browser/configurationService.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,12 +1737,6 @@ suite('WorkspaceConfigurationService - Profiles', () => {
17371737
assert.strictEqual(testObject.getValue('configurationService.profiles.applicationSetting3'), 'defaultProfile');
17381738
}));
17391739

1740-
test('non registering setting should not be read from default profile', () => runWithFakedTimers<void>({ useFakeTimers: true }, async () => {
1741-
await fileService.writeFile(instantiationService.get(IUserDataProfilesService).defaultProfile.settingsResource, VSBuffer.fromString('{ "configurationService.profiles.nonregistered": "defaultProfile" }'));
1742-
await testObject.reloadConfiguration();
1743-
assert.strictEqual(testObject.getValue('configurationService.profiles.nonregistered'), undefined);
1744-
}));
1745-
17461740
test('initialize with custom all profiles settings', () => runWithFakedTimers<void>({ useFakeTimers: true }, async () => {
17471741
await testObject.updateValue(APPLY_ALL_PROFILES_SETTING, ['configurationService.profiles.testSetting2'], ConfigurationTarget.USER_LOCAL);
17481742

0 commit comments

Comments
 (0)