mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -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:
@@ -12,10 +12,12 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { toResource } from 'vs/workbench/common/editor';
|
||||
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { relative } from 'path';
|
||||
|
||||
export class ConfigurationResolverService implements IConfigurationResolverService {
|
||||
_serviceBrand: any;
|
||||
@@ -68,7 +70,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
}
|
||||
|
||||
private get relativeFile(): string {
|
||||
return (this.workspaceRoot) ? paths.relative(this.workspaceRoot, this.file) : this.file;
|
||||
return (this.workspaceRoot) ? paths.normalize(relative(this.workspaceRoot, this.file)) : this.file;
|
||||
}
|
||||
|
||||
private get fileBasename(): string {
|
||||
@@ -91,7 +93,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
private get lineNumber(): string {
|
||||
const activeEditor = this.editorService.getActiveEditor();
|
||||
if (activeEditor) {
|
||||
const editorControl = (<ICommonCodeEditor>activeEditor.getControl());
|
||||
const editorControl = (<ICodeEditor>activeEditor.getControl());
|
||||
if (editorControl) {
|
||||
const lineNumber = editorControl.getSelection().positionLineNumber;
|
||||
return String(lineNumber);
|
||||
@@ -103,10 +105,14 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
|
||||
private getFilePath(): string {
|
||||
let input = this.editorService.getActiveEditorInput();
|
||||
if (input instanceof DiffEditorInput) {
|
||||
input = input.modifiedInput;
|
||||
}
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
let fileResource = toResource(input, { filter: 'file' });
|
||||
|
||||
const fileResource = toResource(input, { filter: 'file' });
|
||||
if (!fileResource) {
|
||||
return '';
|
||||
}
|
||||
@@ -133,7 +139,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
}
|
||||
|
||||
public resolveAny<T>(root: IWorkspaceFolder, value: T): T;
|
||||
public resolveAny<T>(root: IWorkspaceFolder, value: any): any {
|
||||
public resolveAny(root: IWorkspaceFolder, value: any): any {
|
||||
try {
|
||||
this._lastWorkspaceFolder = root;
|
||||
if (types.isString(value)) {
|
||||
@@ -166,7 +172,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
|
||||
private resolveConfigVariable(root: IWorkspaceFolder, value: string, originalValue: string): string {
|
||||
const replacer = (match: string, name: string) => {
|
||||
let config = this.configurationService.getConfiguration<any>({ resource: root.uri });
|
||||
let config = this.configurationService.getValue<any>({ resource: root.uri });
|
||||
let newValue: any;
|
||||
try {
|
||||
const keys: string[] = name.split('.');
|
||||
@@ -205,7 +211,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
|
||||
}
|
||||
|
||||
private resolveAnyLiteral<T>(root: IWorkspaceFolder, values: T): T;
|
||||
private resolveAnyLiteral<T>(root: IWorkspaceFolder, values: any): any {
|
||||
private resolveAnyLiteral(root: IWorkspaceFolder, values: any): any {
|
||||
let result: IStringDictionary<string | IStringDictionary<string> | string[]> = Object.create(null);
|
||||
Object.keys(values).forEach(key => {
|
||||
let value = values[key];
|
||||
@@ -10,7 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IConfigurationService, getConfigurationValue, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
|
||||
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/node/configurationResolverService';
|
||||
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/electron-browser/configurationResolverService';
|
||||
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { TestEnvironmentService, TestEditorService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
@@ -348,10 +348,9 @@ class MockConfigurationService implements IConfigurationService {
|
||||
public _serviceBrand: any;
|
||||
public serviceId = IConfigurationService;
|
||||
public constructor(private configuration: any = {}) { }
|
||||
public inspect<T>(key: string, overrides?: IConfigurationOverrides): any { return { value: getConfigurationValue<T>(this.getConfiguration(), key), default: getConfigurationValue<T>(this.getConfiguration(), key), user: getConfigurationValue<T>(this.getConfiguration(), key), workspaceFolder: void 0, folder: void 0 }; }
|
||||
public inspect<T>(key: string, overrides?: IConfigurationOverrides): any { return { value: getConfigurationValue<T>(this.getValue(), key), default: getConfigurationValue<T>(this.getValue(), key), user: getConfigurationValue<T>(this.getValue(), key), workspaceFolder: void 0, folder: void 0 }; }
|
||||
public keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; }
|
||||
public getConfiguration(): any { return this.configuration; }
|
||||
public getValue(key: string): any { return getConfigurationValue<any>(this.getConfiguration(), key); }
|
||||
public getValue(): any { return this.configuration; }
|
||||
public updateValue(): TPromise<void> { return null; }
|
||||
public getConfigurationData(): any { return null; }
|
||||
public onDidChangeConfiguration() { return { dispose() { } }; }
|
||||
@@ -364,8 +363,7 @@ class MockCommandService implements ICommandService {
|
||||
public callCount = 0;
|
||||
|
||||
onWillExecuteCommand = () => ({ dispose: () => { } });
|
||||
|
||||
public executeCommand<T>(commandId: string, ...args: any[]): TPromise<any> {
|
||||
public executeCommand(commandId: string, ...args: any[]): TPromise<any> {
|
||||
this.callCount++;
|
||||
return TPromise.as(commandId);
|
||||
}
|
||||
Reference in New Issue
Block a user