mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 (#8722)
* Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 * remove tests that aren't working
This commit is contained in:
@@ -67,22 +67,22 @@ export interface IConfigurationChangeEvent {
|
||||
|
||||
export interface IConfigurationValue<T> {
|
||||
|
||||
readonly default?: T;
|
||||
readonly user?: T;
|
||||
readonly userLocal?: T;
|
||||
readonly userRemote?: T;
|
||||
readonly workspace?: T;
|
||||
readonly workspaceFolder?: T;
|
||||
readonly memory?: T;
|
||||
readonly defaultValue?: T;
|
||||
readonly userValue?: T;
|
||||
readonly userLocalValue?: T;
|
||||
readonly userRemoteValue?: T;
|
||||
readonly workspaceValue?: T;
|
||||
readonly workspaceFolderValue?: T;
|
||||
readonly memoryValue?: T;
|
||||
readonly value?: T;
|
||||
|
||||
readonly defaultTarget?: { value?: T, override?: T };
|
||||
readonly userTarget?: { value?: T, override?: T };
|
||||
readonly userLocalTarget?: { value?: T, override?: T };
|
||||
readonly userRemoteTarget?: { value?: T, override?: T };
|
||||
readonly workspaceTarget?: { value?: T, override?: T };
|
||||
readonly workspaceFolderTarget?: { value?: T, override?: T };
|
||||
readonly memoryTarget?: { value?: T, override?: T };
|
||||
readonly default?: { value?: T, override?: T };
|
||||
readonly user?: { value?: T, override?: T };
|
||||
readonly userLocal?: { value?: T, override?: T };
|
||||
readonly userRemote?: { value?: T, override?: T };
|
||||
readonly workspace?: { value?: T, override?: T };
|
||||
readonly workspaceFolder?: { value?: T, override?: T };
|
||||
readonly memory?: { value?: T, override?: T };
|
||||
}
|
||||
|
||||
export interface IConfigurationService {
|
||||
@@ -216,14 +216,11 @@ export function compare(from: IConfigurationModel | undefined, to: IConfiguratio
|
||||
|
||||
export function toOverrides(raw: any, conflictReporter: (message: string) => void): IOverrides[] {
|
||||
const overrides: IOverrides[] = [];
|
||||
const configurationProperties = Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurationProperties();
|
||||
for (const key of Object.keys(raw)) {
|
||||
if (OVERRIDE_PROPERTY_PATTERN.test(key)) {
|
||||
const overrideRaw: any = {};
|
||||
for (const keyInOverrideRaw in raw[key]) {
|
||||
if (configurationProperties[keyInOverrideRaw] && configurationProperties[keyInOverrideRaw].overridable) {
|
||||
overrideRaw[keyInOverrideRaw] = raw[key][keyInOverrideRaw];
|
||||
}
|
||||
overrideRaw[keyInOverrideRaw] = raw[key][keyInOverrideRaw];
|
||||
}
|
||||
overrides.push({
|
||||
identifiers: [overrideIdentifierFromKey(key).trim()],
|
||||
@@ -361,11 +358,11 @@ export function getMigratedSettingValue<T>(configurationService: IConfigurationS
|
||||
const setting = configurationService.inspect<T>(currentSettingName);
|
||||
const legacySetting = configurationService.inspect<T>(legacySettingName);
|
||||
|
||||
if (typeof setting.user !== 'undefined' || typeof setting.workspace !== 'undefined' || typeof setting.workspaceFolder !== 'undefined') {
|
||||
if (typeof setting.userValue !== 'undefined' || typeof setting.workspaceValue !== 'undefined' || typeof setting.workspaceFolderValue !== 'undefined') {
|
||||
return setting.value!;
|
||||
} else if (typeof legacySetting.user !== 'undefined' || typeof legacySetting.workspace !== 'undefined' || typeof legacySetting.workspaceFolder !== 'undefined') {
|
||||
} else if (typeof legacySetting.userValue !== 'undefined' || typeof legacySetting.workspaceValue !== 'undefined' || typeof legacySetting.workspaceFolderValue !== 'undefined') {
|
||||
return legacySetting.value!;
|
||||
} else {
|
||||
return setting.default!;
|
||||
return setting.defaultValue!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,22 +394,22 @@ export class Configuration {
|
||||
const value = consolidateConfigurationModel.getValue<C>(key);
|
||||
|
||||
return {
|
||||
default: defaultValue,
|
||||
user: userValue,
|
||||
userLocal: userLocalValue,
|
||||
userRemote: userRemoteValue,
|
||||
workspace: workspaceValue,
|
||||
workspaceFolder: workspaceFolderValue,
|
||||
memory: memoryValue,
|
||||
defaultValue: defaultValue,
|
||||
userValue: userValue,
|
||||
userLocalValue: userLocalValue,
|
||||
userRemoteValue: userRemoteValue,
|
||||
workspaceValue: workspaceValue,
|
||||
workspaceFolderValue: workspaceFolderValue,
|
||||
memoryValue: memoryValue,
|
||||
value,
|
||||
|
||||
defaultTarget: defaultValue !== undefined ? { value: this._defaultConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._defaultConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
userTarget: userValue !== undefined ? { value: this.userConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.userConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
userLocalTarget: userLocalValue !== undefined ? { value: this.localUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.localUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
userRemoteTarget: userRemoteValue !== undefined ? { value: this.remoteUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.remoteUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
workspaceTarget: workspaceValue !== undefined ? { value: this._workspaceConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
workspaceFolderTarget: workspaceFolderValue !== undefined ? { value: folderConfigurationModel?.freeze().getValue(key), override: overrides.overrideIdentifier ? folderConfigurationModel?.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
memoryTarget: memoryValue !== undefined ? { value: memoryConfigurationModel.getValue(key), override: overrides.overrideIdentifier ? memoryConfigurationModel.getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
default: defaultValue !== undefined ? { value: this._defaultConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._defaultConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
user: userValue !== undefined ? { value: this.userConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.userConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
userLocal: userLocalValue !== undefined ? { value: this.localUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.localUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
userRemote: userRemoteValue !== undefined ? { value: this.remoteUserConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this.remoteUserConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
workspace: workspaceValue !== undefined ? { value: this._workspaceConfiguration.freeze().getValue(key), override: overrides.overrideIdentifier ? this._workspaceConfiguration.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
workspaceFolder: workspaceFolderValue !== undefined ? { value: folderConfigurationModel?.freeze().getValue(key), override: overrides.overrideIdentifier ? folderConfigurationModel?.freeze().getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
memory: memoryValue !== undefined ? { value: memoryConfigurationModel.getValue(key), override: overrides.overrideIdentifier ? memoryConfigurationModel.getOverrideValue(key, overrides.overrideIdentifier) : undefined } : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,10 @@ export const enum ConfigurationScope {
|
||||
* Resource specific configuration, which can be configured in the user, workspace or folder settings.
|
||||
*/
|
||||
RESOURCE,
|
||||
/**
|
||||
* Resource specific configuration that can also be configured in language specific settings
|
||||
*/
|
||||
RESOURCE_LANGUAGE,
|
||||
/**
|
||||
* Machine specific configuration that can also be configured in workspace or folder settings.
|
||||
*/
|
||||
@@ -106,7 +110,6 @@ export const enum ConfigurationScope {
|
||||
}
|
||||
|
||||
export interface IConfigurationPropertySchema extends IJSONSchema {
|
||||
overridable?: boolean;
|
||||
scope?: ConfigurationScope;
|
||||
included?: boolean;
|
||||
tags?: string[];
|
||||
@@ -124,7 +127,6 @@ export interface IConfigurationNode {
|
||||
description?: string;
|
||||
properties?: { [path: string]: IConfigurationPropertySchema; };
|
||||
allOf?: IConfigurationNode[];
|
||||
overridable?: boolean;
|
||||
scope?: ConfigurationScope;
|
||||
extensionInfo?: IConfigurationExtensionInfo;
|
||||
}
|
||||
@@ -144,7 +146,8 @@ export const machineOverridableSettings: { properties: SettingProperties, patter
|
||||
export const windowSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
export const resourceSettings: { properties: SettingProperties, patternProperties: SettingProperties } = { properties: {}, patternProperties: {} };
|
||||
|
||||
export const editorConfigurationSchemaId = 'vscode://schemas/settings/editor';
|
||||
export const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';
|
||||
|
||||
const contributionRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
|
||||
|
||||
class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
@@ -153,7 +156,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
private readonly configurationContributors: IConfigurationNode[];
|
||||
private readonly configurationProperties: { [qualifiedKey: string]: IJSONSchema };
|
||||
private readonly excludedConfigurationProperties: { [qualifiedKey: string]: IJSONSchema };
|
||||
private readonly editorConfigurationSchema: IJSONSchema;
|
||||
private readonly resourceLanguageSettingsSchema: IJSONSchema;
|
||||
private readonly overrideIdentifiers: string[] = [];
|
||||
private overridePropertyPattern: string;
|
||||
|
||||
@@ -170,12 +173,12 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
properties: {}
|
||||
};
|
||||
this.configurationContributors = [this.defaultOverridesConfigurationNode];
|
||||
this.editorConfigurationSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowTrailingCommas: true, allowComments: true };
|
||||
this.resourceLanguageSettingsSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowTrailingCommas: true, allowComments: true };
|
||||
this.configurationProperties = {};
|
||||
this.excludedConfigurationProperties = {};
|
||||
this.overridePropertyPattern = this.computeOverridePropertyPattern();
|
||||
|
||||
contributionRegistry.registerSchema(editorConfigurationSchemaId, this.editorConfigurationSchema);
|
||||
contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
|
||||
}
|
||||
|
||||
public registerConfiguration(configuration: IConfigurationNode, validate: boolean = true): void {
|
||||
@@ -188,9 +191,9 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
properties.push(...this.validateAndRegisterProperties(configuration, validate)); // fills in defaults
|
||||
this.configurationContributors.push(configuration);
|
||||
this.registerJSONConfiguration(configuration);
|
||||
this.updateSchemaForOverrideSettingsConfiguration(configuration);
|
||||
});
|
||||
|
||||
contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
|
||||
this._onDidSchemaChange.fire();
|
||||
this._onDidUpdateConfiguration.fire(properties);
|
||||
}
|
||||
@@ -203,7 +206,6 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
properties.push(key);
|
||||
|
||||
delete this.configurationProperties[key];
|
||||
delete this.editorConfigurationSchema.properties![key];
|
||||
|
||||
// Delete from schema
|
||||
delete allSettings.properties[key];
|
||||
@@ -221,6 +223,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
delete windowSettings.properties[key];
|
||||
break;
|
||||
case ConfigurationScope.RESOURCE:
|
||||
case ConfigurationScope.RESOURCE_LANGUAGE:
|
||||
delete resourceSettings.properties[key];
|
||||
break;
|
||||
}
|
||||
@@ -238,7 +241,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
contributionRegistry.registerSchema(editorConfigurationSchemaId, this.editorConfigurationSchema);
|
||||
contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);
|
||||
this._onDidSchemaChange.fire();
|
||||
this._onDidUpdateConfiguration.fire(properties);
|
||||
}
|
||||
@@ -254,7 +257,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
type: 'object',
|
||||
default: defaultValue,
|
||||
description: nls.localize('overrideSettings.description', "Configure editor settings to be overridden for {0} language.", key),
|
||||
$ref: editorConfigurationSchemaId
|
||||
$ref: resourceLanguageSettingsSchemaId
|
||||
};
|
||||
allSettings.properties[key] = propertySchema;
|
||||
this.defaultOverridesConfigurationNode.properties![key] = propertySchema;
|
||||
@@ -291,9 +294,8 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
this.updateOverridePropertyPatternKey();
|
||||
}
|
||||
|
||||
private validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, scope: ConfigurationScope = ConfigurationScope.WINDOW, overridable: boolean = false): string[] {
|
||||
private validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, scope: ConfigurationScope = ConfigurationScope.WINDOW): string[] {
|
||||
scope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;
|
||||
overridable = configuration.overridable || overridable;
|
||||
let propertyKeys: string[] = [];
|
||||
let properties = configuration.properties;
|
||||
if (properties) {
|
||||
@@ -310,11 +312,6 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
if (types.isUndefined(defaultValue)) {
|
||||
property.default = getDefaultValue(property.type);
|
||||
}
|
||||
// Inherit overridable property from parent
|
||||
if (overridable) {
|
||||
property.overridable = true;
|
||||
}
|
||||
|
||||
if (OVERRIDE_PROPERTY_PATTERN.test(key)) {
|
||||
property.scope = undefined; // No scope for overridable properties `[${identifier}]`
|
||||
} else {
|
||||
@@ -337,7 +334,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
let subNodes = configuration.allOf;
|
||||
if (subNodes) {
|
||||
for (let node of subNodes) {
|
||||
propertyKeys.push(...this.validateAndRegisterProperties(node, validate, scope, overridable));
|
||||
propertyKeys.push(...this.validateAndRegisterProperties(node, validate, scope));
|
||||
}
|
||||
}
|
||||
return propertyKeys;
|
||||
@@ -356,7 +353,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
}
|
||||
|
||||
private registerJSONConfiguration(configuration: IConfigurationNode) {
|
||||
function register(configuration: IConfigurationNode) {
|
||||
const register = (configuration: IConfigurationNode) => {
|
||||
let properties = configuration.properties;
|
||||
if (properties) {
|
||||
for (const key in properties) {
|
||||
@@ -377,6 +374,10 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
case ConfigurationScope.RESOURCE:
|
||||
resourceSettings.properties[key] = properties[key];
|
||||
break;
|
||||
case ConfigurationScope.RESOURCE_LANGUAGE:
|
||||
resourceSettings.properties[key] = properties[key];
|
||||
this.resourceLanguageSettingsSchema.properties![key] = properties[key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,17 +385,10 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
if (subNodes) {
|
||||
subNodes.forEach(register);
|
||||
}
|
||||
}
|
||||
};
|
||||
register(configuration);
|
||||
}
|
||||
|
||||
private updateSchemaForOverrideSettingsConfiguration(configuration: IConfigurationNode): void {
|
||||
if (configuration.id !== SETTINGS_OVERRRIDE_NODE_ID) {
|
||||
this.update(configuration);
|
||||
contributionRegistry.registerSchema(editorConfigurationSchemaId, this.editorConfigurationSchema);
|
||||
}
|
||||
}
|
||||
|
||||
private updateOverridePropertyPatternKey(): void {
|
||||
let patternProperties: IJSONSchema = allSettings.patternProperties[this.overridePropertyPattern];
|
||||
if (!patternProperties) {
|
||||
@@ -402,7 +396,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
type: 'object',
|
||||
description: nls.localize('overrideSettings.defaultDescription', "Configure editor settings to be overridden for a language."),
|
||||
errorMessage: 'Unknown Identifier. Use language identifiers',
|
||||
$ref: editorConfigurationSchemaId
|
||||
$ref: resourceLanguageSettingsSchemaId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -425,27 +419,11 @@ class ConfigurationRegistry implements IConfigurationRegistry {
|
||||
this._onDidSchemaChange.fire();
|
||||
}
|
||||
|
||||
private update(configuration: IConfigurationNode): void {
|
||||
let properties = configuration.properties;
|
||||
if (properties) {
|
||||
for (let key in properties) {
|
||||
if (properties[key].overridable) {
|
||||
this.editorConfigurationSchema.properties![key] = this.getConfigurationProperties()[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
let subNodes = configuration.allOf;
|
||||
if (subNodes) {
|
||||
subNodes.forEach(subNode => this.update(subNode));
|
||||
}
|
||||
}
|
||||
|
||||
private computeOverridePropertyPattern(): string {
|
||||
return this.overrideIdentifiers.length ? OVERRIDE_PATTERN_WITH_SUBSTITUTION.replace('${0}', this.overrideIdentifiers.map(identifier => strings.createRegExp(identifier, false).source).join('|')) : OVERRIDE_PROPERTY;
|
||||
}
|
||||
}
|
||||
|
||||
const SETTINGS_OVERRRIDE_NODE_ID = 'override';
|
||||
const OVERRIDE_PROPERTY = '\\[.*\\]$';
|
||||
const OVERRIDE_PATTERN_WITH_SUBSTITUTION = '\\[(${0})\\]$';
|
||||
export const OVERRIDE_PROPERTY_PATTERN = new RegExp(OVERRIDE_PROPERTY);
|
||||
|
||||
@@ -234,23 +234,6 @@ suite('ConfigurationModel', () => {
|
||||
|
||||
suite('CustomConfigurationModel', () => {
|
||||
|
||||
suiteSetup(() => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'overridable': true
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('simple merge using models', () => {
|
||||
let base = new ConfigurationModelParser('base');
|
||||
base.parseContent(JSON.stringify({ 'a': 1, 'b': 2 }));
|
||||
@@ -346,6 +329,19 @@ suite('CustomConfigurationModel', () => {
|
||||
});
|
||||
|
||||
test('Test registering the same property again', () => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
}
|
||||
}
|
||||
});
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
|
||||
@@ -60,8 +60,8 @@ export class TestConfigurationService implements IConfigurationService {
|
||||
|
||||
return {
|
||||
value: getConfigurationValue<T>(config, key),
|
||||
default: getConfigurationValue<T>(config, key),
|
||||
user: getConfigurationValue<T>(config, key)
|
||||
defaultValue: getConfigurationValue<T>(config, key),
|
||||
userValue: getConfigurationValue<T>(config, key)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -210,20 +210,20 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
let res = service.inspect('something.missing');
|
||||
assert.strictEqual(res.value, undefined);
|
||||
assert.strictEqual(res.default, undefined);
|
||||
assert.strictEqual(res.user, undefined);
|
||||
assert.strictEqual(res.defaultValue, undefined);
|
||||
assert.strictEqual(res.userValue, undefined);
|
||||
|
||||
res = service.inspect('lookup.service.testSetting');
|
||||
assert.strictEqual(res.default, 'isSet');
|
||||
assert.strictEqual(res.defaultValue, 'isSet');
|
||||
assert.strictEqual(res.value, 'isSet');
|
||||
assert.strictEqual(res.user, undefined);
|
||||
assert.strictEqual(res.userValue, undefined);
|
||||
|
||||
fs.writeFileSync(r.testFile, '{ "lookup.service.testSetting": "bar" }');
|
||||
|
||||
await service.reloadConfiguration();
|
||||
res = service.inspect('lookup.service.testSetting');
|
||||
assert.strictEqual(res.default, 'isSet');
|
||||
assert.strictEqual(res.user, 'bar');
|
||||
assert.strictEqual(res.defaultValue, 'isSet');
|
||||
assert.strictEqual(res.userValue, 'bar');
|
||||
assert.strictEqual(res.value, 'bar');
|
||||
|
||||
service.dispose();
|
||||
@@ -247,18 +247,18 @@ suite('ConfigurationService - Node', () => {
|
||||
service.initialize();
|
||||
|
||||
let res = service.inspect('lookup.service.testNullSetting');
|
||||
assert.strictEqual(res.default, null);
|
||||
assert.strictEqual(res.defaultValue, null);
|
||||
assert.strictEqual(res.value, null);
|
||||
assert.strictEqual(res.user, undefined);
|
||||
assert.strictEqual(res.userValue, undefined);
|
||||
|
||||
fs.writeFileSync(r.testFile, '{ "lookup.service.testNullSetting": null }');
|
||||
|
||||
await service.reloadConfiguration();
|
||||
|
||||
res = service.inspect('lookup.service.testNullSetting');
|
||||
assert.strictEqual(res.default, null);
|
||||
assert.strictEqual(res.defaultValue, null);
|
||||
assert.strictEqual(res.value, null);
|
||||
assert.strictEqual(res.user, null);
|
||||
assert.strictEqual(res.userValue, null);
|
||||
|
||||
service.dispose();
|
||||
return r.cleanUp();
|
||||
|
||||
Reference in New Issue
Block a user