mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 10:58:31 -05:00
Merge vscode 1.67 (#20883)
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
This commit is contained in:
@@ -17,6 +17,18 @@ suite('Configuration', () => {
|
||||
assert.deepStrictEqual(base, { 'a': 1, 'b': 2, 'c': 4 });
|
||||
});
|
||||
|
||||
test('object merge', () => {
|
||||
let base = { 'a': { 'b': 1, 'c': true, 'd': 2 } };
|
||||
merge(base, { 'a': { 'b': undefined, 'c': false, 'e': 'a' } }, true);
|
||||
assert.deepStrictEqual(base, { 'a': { 'b': undefined, 'c': false, 'd': 2, 'e': 'a' } });
|
||||
});
|
||||
|
||||
test('array merge', () => {
|
||||
let base = { 'a': ['b', 'c'] };
|
||||
merge(base, { 'a': ['b', 'd'] }, true);
|
||||
assert.deepStrictEqual(base, { 'a': ['b', 'd'] });
|
||||
});
|
||||
|
||||
test('removeFromValueTree: remove a non existing key', () => {
|
||||
let target = { 'a': { 'b': 2 } };
|
||||
|
||||
|
||||
@@ -12,6 +12,35 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { WorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { Workspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
|
||||
suite('ConfigurationModelParser', () => {
|
||||
|
||||
test('parse configuration model with single override identifier', () => {
|
||||
const testObject = new ConfigurationModelParser('');
|
||||
|
||||
testObject.parse(JSON.stringify({ '[x]': { 'a': 1 } }));
|
||||
|
||||
assert.deepStrictEqual(JSON.stringify(testObject.configurationModel.overrides), JSON.stringify([{ identifiers: ['x'], keys: ['a'], contents: { 'a': 1 } }]));
|
||||
});
|
||||
|
||||
test('parse configuration model with multiple override identifiers', () => {
|
||||
const testObject = new ConfigurationModelParser('');
|
||||
|
||||
testObject.parse(JSON.stringify({ '[x][y]': { 'a': 1 } }));
|
||||
|
||||
assert.deepStrictEqual(JSON.stringify(testObject.configurationModel.overrides), JSON.stringify([{ identifiers: ['x', 'y'], keys: ['a'], contents: { 'a': 1 } }]));
|
||||
});
|
||||
|
||||
test('parse configuration model with multiple duplicate override identifiers', () => {
|
||||
const testObject = new ConfigurationModelParser('');
|
||||
|
||||
testObject.parse(JSON.stringify({ '[x][y][x][z]': { 'a': 1 } }));
|
||||
|
||||
assert.deepStrictEqual(JSON.stringify(testObject.configurationModel.overrides), JSON.stringify([{ identifiers: ['x', 'y', 'z'], keys: ['a'], contents: { 'a': 1 } }]));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
suite('ConfigurationModel', () => {
|
||||
|
||||
test('setValue for a key that has no sections and not defined', () => {
|
||||
@@ -190,7 +219,7 @@ suite('ConfigurationModel', () => {
|
||||
let result = base.merge(add);
|
||||
|
||||
assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 } });
|
||||
assert.deepStrictEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': 2, 'b': 2 }, keys: ['a'] }]);
|
||||
assert.deepStrictEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': 2, 'b': 2 }, keys: ['a', 'b'] }]);
|
||||
assert.deepStrictEqual(result.override('c').contents, { 'a': 2, 'b': 2 });
|
||||
assert.deepStrictEqual(result.keys, ['a.b']);
|
||||
});
|
||||
@@ -236,6 +265,45 @@ suite('ConfigurationModel', () => {
|
||||
|
||||
assert.deepStrictEqual(testObject.override('b').contents, { 'a': 2, 'c': 1 });
|
||||
});
|
||||
|
||||
test('Test override when an override has multiple identifiers', () => {
|
||||
const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, ['a', 'c'], [{ identifiers: ['x', 'y'], contents: { 'a': 2 }, keys: ['a'] }]);
|
||||
|
||||
let actual = testObject.override('x');
|
||||
assert.deepStrictEqual(actual.contents, { 'a': 2, 'c': 1 });
|
||||
assert.deepStrictEqual(actual.keys, ['a', 'c']);
|
||||
assert.deepStrictEqual(testObject.getKeysForOverrideIdentifier('x'), ['a']);
|
||||
|
||||
actual = testObject.override('y');
|
||||
assert.deepStrictEqual(actual.contents, { 'a': 2, 'c': 1 });
|
||||
assert.deepStrictEqual(actual.keys, ['a', 'c']);
|
||||
assert.deepStrictEqual(testObject.getKeysForOverrideIdentifier('y'), ['a']);
|
||||
});
|
||||
|
||||
test('Test override when an identifier is defined in multiple overrides', () => {
|
||||
const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, ['a', 'c'], [{ identifiers: ['x'], contents: { 'a': 3, 'b': 1 }, keys: ['a', 'b'] }, { identifiers: ['x', 'y'], contents: { 'a': 2 }, keys: ['a'] }]);
|
||||
|
||||
const actual = testObject.override('x');
|
||||
assert.deepStrictEqual(actual.contents, { 'a': 3, 'c': 1, 'b': 1 });
|
||||
assert.deepStrictEqual(actual.keys, ['a', 'c']);
|
||||
|
||||
assert.deepStrictEqual(testObject.getKeysForOverrideIdentifier('x'), ['a', 'b']);
|
||||
});
|
||||
|
||||
test('Test merge when configuration models have multiple identifiers', () => {
|
||||
const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, ['a', 'c'], [{ identifiers: ['y'], contents: { 'c': 1 }, keys: ['c'] }, { identifiers: ['x', 'y'], contents: { 'a': 2 }, keys: ['a'] }]);
|
||||
const target = new ConfigurationModel({ 'a': 2, 'b': 1 }, ['a', 'b'], [{ identifiers: ['x'], contents: { 'a': 3, 'b': 2 }, keys: ['a', 'b'] }, { identifiers: ['x', 'y'], contents: { 'b': 3 }, keys: ['b'] }]);
|
||||
|
||||
const actual = testObject.merge(target);
|
||||
|
||||
assert.deepStrictEqual(actual.contents, { 'a': 2, 'c': 1, 'b': 1 });
|
||||
assert.deepStrictEqual(actual.keys, ['a', 'c', 'b']);
|
||||
assert.deepStrictEqual(actual.overrides, [
|
||||
{ identifiers: ['y'], contents: { 'c': 1 }, keys: ['c'] },
|
||||
{ identifiers: ['x', 'y'], contents: { 'a': 2, 'b': 3 }, keys: ['a', 'b'] },
|
||||
{ identifiers: ['x'], contents: { 'a': 3, 'b': 2 }, keys: ['a', 'b'] },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
suite('CustomConfigurationModel', () => {
|
||||
@@ -375,6 +443,43 @@ suite('CustomConfigurationModel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
suite('CustomConfigurationModel', () => {
|
||||
|
||||
test('Default configuration model uses overrides', () => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
}
|
||||
}
|
||||
});
|
||||
assert.strictEqual(true, new DefaultConfigurationModel().getValue('a'));
|
||||
});
|
||||
|
||||
test('Default configuration model uses overrides', () => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
}
|
||||
}
|
||||
});
|
||||
assert.strictEqual(false, new DefaultConfigurationModel({ a: false }).getValue('a'));
|
||||
});
|
||||
});
|
||||
|
||||
suite('Configuration', () => {
|
||||
|
||||
test('Test inspect for overrideIdentifiers', () => {
|
||||
@@ -582,11 +687,14 @@ suite('ConfigurationChangeEvent', () => {
|
||||
'files.autoSave': 'off',
|
||||
'[markdown]': {
|
||||
'editor.wordWrap': 'off'
|
||||
},
|
||||
'[typescript][jsonc]': {
|
||||
'editor.lineNumbers': 'off'
|
||||
}
|
||||
}));
|
||||
let testObject = new ConfigurationChangeEvent(change, undefined, configuration);
|
||||
|
||||
assert.deepStrictEqual(testObject.affectedKeys, ['files.autoSave', '[markdown]', 'editor.wordWrap']);
|
||||
assert.deepStrictEqual(testObject.affectedKeys, ['files.autoSave', '[markdown]', '[typescript][jsonc]', 'editor.wordWrap', 'editor.lineNumbers']);
|
||||
|
||||
assert.ok(testObject.affectsConfiguration('files'));
|
||||
assert.ok(testObject.affectsConfiguration('files.autoSave'));
|
||||
@@ -598,8 +706,16 @@ suite('ConfigurationChangeEvent', () => {
|
||||
|
||||
assert.ok(testObject.affectsConfiguration('editor'));
|
||||
assert.ok(testObject.affectsConfiguration('editor.wordWrap'));
|
||||
assert.ok(testObject.affectsConfiguration('editor.lineNumbers'));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'jsonc' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'typescript' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.wordWrap', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.wordWrap', { overrideIdentifier: 'jsonc' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.wordWrap', { overrideIdentifier: 'typescript' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'typescript' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'jsonc' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor', { overrideIdentifier: 'json' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.fontSize', { overrideIdentifier: 'markdown' }));
|
||||
|
||||
@@ -615,6 +731,10 @@ suite('ConfigurationChangeEvent', () => {
|
||||
'editor.fontSize': 12,
|
||||
'editor.wordWrap': 'off'
|
||||
},
|
||||
'[css][scss]': {
|
||||
'editor.lineNumbers': 'off',
|
||||
'css.lint.emptyRules': 'error'
|
||||
},
|
||||
'files.autoSave': 'off',
|
||||
}));
|
||||
const data = configuration.toData();
|
||||
@@ -624,11 +744,15 @@ suite('ConfigurationChangeEvent', () => {
|
||||
'editor.fontSize': 13,
|
||||
'editor.wordWrap': 'off'
|
||||
},
|
||||
'[css][scss]': {
|
||||
'editor.lineNumbers': 'relative',
|
||||
'css.lint.emptyRules': 'error'
|
||||
},
|
||||
'window.zoomLevel': 1,
|
||||
}));
|
||||
let testObject = new ConfigurationChangeEvent(change, { data }, configuration);
|
||||
|
||||
assert.deepStrictEqual(testObject.affectedKeys, ['window.zoomLevel', '[markdown]', 'workbench.editor.enablePreview', 'editor.fontSize']);
|
||||
assert.deepStrictEqual(testObject.affectedKeys, ['window.zoomLevel', '[markdown]', '[css][scss]', 'workbench.editor.enablePreview', 'editor.fontSize', 'editor.lineNumbers']);
|
||||
|
||||
assert.ok(!testObject.affectsConfiguration('files'));
|
||||
|
||||
@@ -637,10 +761,18 @@ suite('ConfigurationChangeEvent', () => {
|
||||
assert.ok(!testObject.affectsConfiguration('[markdown].editor.fontSize'));
|
||||
assert.ok(!testObject.affectsConfiguration('[markdown].editor.wordWrap'));
|
||||
assert.ok(!testObject.affectsConfiguration('[markdown].workbench'));
|
||||
assert.ok(testObject.affectsConfiguration('[css][scss]'));
|
||||
|
||||
assert.ok(testObject.affectsConfiguration('editor'));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'css' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor', { overrideIdentifier: 'scss' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.fontSize', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.fontSize', { overrideIdentifier: 'css' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.fontSize', { overrideIdentifier: 'scss' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'scss' }));
|
||||
assert.ok(testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'css' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.lineNumbers', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.wordWrap'));
|
||||
assert.ok(!testObject.affectsConfiguration('editor.wordWrap', { overrideIdentifier: 'markdown' }));
|
||||
assert.ok(!testObject.affectsConfiguration('editor', { overrideIdentifier: 'json' }));
|
||||
|
||||
@@ -21,16 +21,16 @@ suite('ConfigurationRegistry', () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config': { a: 1, b: 2 } } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { '[lang]': { a: 2, c: 3 } } }]);
|
||||
|
||||
assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 1, b: 2 });
|
||||
assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, c: 3 });
|
||||
});
|
||||
|
||||
test('configuration override defaults - merges defaults', async () => {
|
||||
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 1, b: 2 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { '[lang]': { a: 1, b: 2 } } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { '[lang]': { a: 2, c: 3 } } }]);
|
||||
|
||||
assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, b: 2, c: 3 });
|
||||
});
|
||||
@@ -45,8 +45,8 @@ suite('ConfigurationRegistry', () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 2, c: 3 } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config': { a: 1, b: 2 } } }]);
|
||||
configurationRegistry.registerDefaultConfigurations([{ overrides: { 'config': { a: 2, c: 3 } } }]);
|
||||
|
||||
assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, c: 3 });
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ suite('ConfigurationService', () => {
|
||||
configuration: {
|
||||
service: {
|
||||
testSetting: string;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,16 @@
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TernarySearchTree } from 'vs/base/common/map';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { getConfigurationKeys, getConfigurationValue, IConfigurationOverrides, IConfigurationService, IConfigurationValue, isConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
|
||||
import { getConfigurationValue, IConfigurationChangeEvent, IConfigurationOverrides, IConfigurationService, IConfigurationValue, isConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
|
||||
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
export class TestConfigurationService implements IConfigurationService {
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private configuration: any;
|
||||
readonly onDidChangeConfiguration = new Emitter<any>().event;
|
||||
readonly onDidChangeConfigurationEmitter = new Emitter<IConfigurationChangeEvent>();
|
||||
readonly onDidChangeConfiguration = this.onDidChangeConfigurationEmitter.event;
|
||||
|
||||
constructor(configuration?: any) {
|
||||
this.configuration = configuration || Object.create(null);
|
||||
@@ -55,19 +58,25 @@ export class TestConfigurationService implements IConfigurationService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
private overrideIdentifiers: Map<string, string[]> = new Map();
|
||||
public setOverrideIdentifiers(key: string, identifiers: string[]): void {
|
||||
this.overrideIdentifiers.set(key, identifiers);
|
||||
}
|
||||
|
||||
public inspect<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<T> {
|
||||
const config = this.getValue(undefined, overrides);
|
||||
|
||||
return {
|
||||
value: getConfigurationValue<T>(config, key),
|
||||
defaultValue: getConfigurationValue<T>(config, key),
|
||||
userValue: getConfigurationValue<T>(config, key)
|
||||
userValue: getConfigurationValue<T>(config, key),
|
||||
overrideIdentifiers: this.overrideIdentifiers.get(key)
|
||||
};
|
||||
}
|
||||
|
||||
public keys() {
|
||||
return {
|
||||
default: getConfigurationKeys(),
|
||||
default: Object.keys(Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurationProperties()),
|
||||
user: Object.keys(this.configuration),
|
||||
workspace: [],
|
||||
workspaceFolder: []
|
||||
|
||||
Reference in New Issue
Block a user