mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -8,10 +8,9 @@
|
||||
import { TernarySearchTree } from 'vs/base/common/map';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { getConfigurationKeys, IConfigurationOverrides, IConfigurationService, getConfigurationValue, isConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export class TestConfigurationService extends EventEmitter implements IConfigurationService {
|
||||
export class TestConfigurationService implements IConfigurationService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private configuration = Object.create(null);
|
||||
@@ -19,23 +18,21 @@ export class TestConfigurationService extends EventEmitter implements IConfigura
|
||||
private configurationByRoot: TernarySearchTree<any> = TernarySearchTree.forPaths<any>();
|
||||
|
||||
public reloadConfiguration<T>(): TPromise<T> {
|
||||
return TPromise.as(this.getConfiguration());
|
||||
return TPromise.as(this.getValue());
|
||||
}
|
||||
|
||||
public getConfiguration<C>(arg1?: any, arg2?: any): C {
|
||||
public getValue(arg1?: any, arg2?: any): any {
|
||||
if (arg1 && typeof arg1 === 'string') {
|
||||
return this.inspect(<string>arg1).value;
|
||||
}
|
||||
const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : void 0;
|
||||
if (overrides && overrides.resource) {
|
||||
const configForResource = this.configurationByRoot.findSubstr(overrides.resource.fsPath);
|
||||
return configForResource || this.configuration;
|
||||
}
|
||||
|
||||
return this.configuration;
|
||||
}
|
||||
|
||||
public getValue(key: string, overrides?: IConfigurationOverrides): any {
|
||||
return this.inspect(key).value;
|
||||
}
|
||||
|
||||
public updateValue(key: string, overrides?: IConfigurationOverrides): TPromise<void> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
@@ -63,7 +60,7 @@ export class TestConfigurationService extends EventEmitter implements IConfigura
|
||||
workspaceFolder: T
|
||||
value: T,
|
||||
} {
|
||||
const config = this.getConfiguration(undefined, overrides);
|
||||
const config = this.getValue(undefined, overrides);
|
||||
|
||||
return {
|
||||
value: getConfigurationValue<T>(config, key),
|
||||
|
||||
Reference in New Issue
Block a user