mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -300,4 +300,4 @@ suite('Workbench base editor', () => {
|
||||
MyEditor: MyEditor,
|
||||
MyOtherEditor: MyOtherEditor
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction, QuickOpenHandler } from 'vs/workbench/browser/quickopen';
|
||||
|
||||
export class TestQuickOpenService implements IQuickOpenService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private callback?: (prefix?: string) => void;
|
||||
|
||||
|
||||
42
src/vs/workbench/test/contrib/linkProtection.test.ts
Normal file
42
src/vs/workbench/test/contrib/linkProtection.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
import { isURLDomainTrusted } from 'vs/workbench/contrib/url/common/url.contribution';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
suite('Link protection domain matching', () => {
|
||||
|
||||
test('simple', () => {
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('https://x.org'), []));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://x.org'), ['https://x.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://x.org/foo'), ['https://x.org']));
|
||||
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('https://x.org'), ['http://x.org']));
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('http://x.org'), ['https://x.org']));
|
||||
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('https://www.x.org'), ['https://x.org']));
|
||||
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://www.x.org'), ['https://www.x.org', 'https://y.org']));
|
||||
});
|
||||
|
||||
test('localhost', () => {
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://127.0.0.1'), []));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://127.0.0.1:3000'), []));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://localhost'), []));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://localhost:3000'), []));
|
||||
});
|
||||
|
||||
test('* star', () => {
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://*.x.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://a.x.*']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://a.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://*.*.org']));
|
||||
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('https://a.b.c.org'), ['https://*.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.b.c.org'), ['https://*.*.*.org']));
|
||||
});
|
||||
});
|
||||
@@ -78,7 +78,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
});
|
||||
instantiationService.stub(IMarkerService, new MarkerService());
|
||||
instantiationService.stub(IModelService, <IModelService>{
|
||||
_serviceBrand: IModelService,
|
||||
_serviceBrand: undefined,
|
||||
getModel(): any { return model; },
|
||||
createModel() { throw new Error(); },
|
||||
updateModel() { throw new Error(); },
|
||||
@@ -857,4 +857,33 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
assert.ok(value[0].parent);
|
||||
});
|
||||
|
||||
// --- call hierarcht
|
||||
|
||||
test('Call Hierarchy, back and forth', async function () {
|
||||
|
||||
disposables.push(extHost.registerCallHierarchyProvider(nullExtensionDescription, defaultSelector, new class implements vscode.CallHierarchyItemProvider {
|
||||
provideCallHierarchyIncomingCalls(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): vscode.ProviderResult<vscode.CallHierarchyIncomingCall[]> {
|
||||
return [
|
||||
new types.CallHierarchyIncomingCall(new types.CallHierarchyItem(types.SymbolKind.Array, 'IN', '', document.uri, new types.Range(0, 0, 2, 0), new types.Range(0, 0, 2, 0)), [new types.Range(0, 0, 0, 0)]),
|
||||
];
|
||||
}
|
||||
provideCallHierarchyOutgoingCalls(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): vscode.ProviderResult<vscode.CallHierarchyOutgoingCall[]> {
|
||||
return [
|
||||
new types.CallHierarchyOutgoingCall(new types.CallHierarchyItem(types.SymbolKind.Array, 'OUT', '', document.uri, new types.Range(0, 0, 2, 0), new types.Range(0, 0, 2, 0)), [new types.Range(0, 0, 0, 0)]),
|
||||
];
|
||||
}
|
||||
}));
|
||||
|
||||
await rpcProtocol.sync();
|
||||
|
||||
let incoming = await commands.executeCommand<vscode.CallHierarchyIncomingCall[]>('vscode.executeCallHierarchyProviderIncomingCalls', model.uri, new types.Position(0, 10));
|
||||
assert.equal(incoming.length, 1);
|
||||
assert.ok(incoming[0].source instanceof types.CallHierarchyItem);
|
||||
assert.equal(incoming[0].source.name, 'IN');
|
||||
|
||||
let outgoing = await commands.executeCommand<vscode.CallHierarchyOutgoingCall[]>('vscode.executeCallHierarchyProviderOutgoingCalls', model.uri, new types.Position(0, 10));
|
||||
assert.equal(outgoing.length, 1);
|
||||
assert.ok(outgoing[0].target instanceof types.CallHierarchyItem);
|
||||
assert.equal(outgoing[0].target.name, 'OUT');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -59,4 +59,35 @@ suite('ExtHostCommands', function () {
|
||||
reg.dispose();
|
||||
assert.equal(unregisterCounter, 1);
|
||||
});
|
||||
|
||||
test('execute with retry', async function () {
|
||||
|
||||
let count = 0;
|
||||
|
||||
const shape = new class extends mock<MainThreadCommandsShape>() {
|
||||
$registerCommand(id: string): void {
|
||||
//
|
||||
}
|
||||
async $executeCommand<T>(id: string, args: any[], retry: boolean): Promise<T | undefined> {
|
||||
count++;
|
||||
assert.equal(retry, count === 1);
|
||||
if (count === 1) {
|
||||
assert.equal(retry, true);
|
||||
throw new Error('$executeCommand:retry');
|
||||
} else {
|
||||
assert.equal(retry, false);
|
||||
return <any>17;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const commands = new ExtHostCommands(
|
||||
SingleProxyRPCProtocol(shape),
|
||||
new NullLogService()
|
||||
);
|
||||
|
||||
const result = await commands.executeCommand('fooo', [this, true]);
|
||||
assert.equal(result, 17);
|
||||
assert.equal(count, 2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,11 +9,10 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
const emptyDialogService = new class implements IDialogService {
|
||||
_serviceBrand: 'dialogService';
|
||||
_serviceBrand: undefined;
|
||||
show(): never {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
@@ -33,7 +32,7 @@ const emptyCommandService: ICommandService = {
|
||||
};
|
||||
|
||||
const emptyNotificationService = new class implements INotificationService {
|
||||
_serviceBrand: ServiceIdentifier<INotificationService>;
|
||||
_serviceBrand: undefined;
|
||||
notify(...args: any[]): never {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
@@ -55,7 +54,7 @@ const emptyNotificationService = new class implements INotificationService {
|
||||
};
|
||||
|
||||
class EmptyNotificationService implements INotificationService {
|
||||
_serviceBrand: ServiceIdentifier<INotificationService>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private withNotify: (notification: INotification) => void) {
|
||||
}
|
||||
@@ -103,7 +102,7 @@ suite('ExtHostMessageService', function () {
|
||||
assert.equal(message, 'h');
|
||||
assert.equal(buttons.length, 2);
|
||||
assert.equal(buttons[1], 'Cancel');
|
||||
return Promise.resolve(0);
|
||||
return Promise.resolve({ choice: 0 });
|
||||
}
|
||||
} as IDialogService);
|
||||
|
||||
@@ -114,7 +113,7 @@ suite('ExtHostMessageService', function () {
|
||||
test('returns undefined when cancelled', async () => {
|
||||
const service = new MainThreadMessageService(null!, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
show() {
|
||||
return Promise.resolve(1);
|
||||
return Promise.resolve({ choice: 1 });
|
||||
}
|
||||
} as IDialogService);
|
||||
|
||||
@@ -126,7 +125,7 @@ suite('ExtHostMessageService', function () {
|
||||
const service = new MainThreadMessageService(null!, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
show(severity: Severity, message: string, buttons: string[]) {
|
||||
assert.equal(buttons.length, 1);
|
||||
return Promise.resolve(0);
|
||||
return Promise.resolve({ choice: 0 });
|
||||
}
|
||||
} as IDialogService);
|
||||
|
||||
|
||||
@@ -5,14 +5,16 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { SingleProxyRPCProtocol } from './testRPCProtocol';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
|
||||
suite('MainThreadCommands', function () {
|
||||
|
||||
test('dispose on unregister', function () {
|
||||
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!);
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!, new class extends mock<IExtensionService>() { });
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
|
||||
// register
|
||||
@@ -26,7 +28,7 @@ suite('MainThreadCommands', function () {
|
||||
|
||||
test('unregister all on dispose', function () {
|
||||
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!);
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!, new class extends mock<IExtensionService>() { });
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
|
||||
commands.$registerCommand('foo');
|
||||
@@ -40,4 +42,46 @@ suite('MainThreadCommands', function () {
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
assert.equal(CommandsRegistry.getCommand('bar'), undefined);
|
||||
});
|
||||
|
||||
test('activate and throw when needed', async function () {
|
||||
|
||||
const activations: string[] = [];
|
||||
const runs: string[] = [];
|
||||
|
||||
const commands = new MainThreadCommands(
|
||||
SingleProxyRPCProtocol(null),
|
||||
new class extends mock<ICommandService>() {
|
||||
executeCommand<T>(id: string): Promise<T | undefined> {
|
||||
runs.push(id);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
},
|
||||
new class extends mock<IExtensionService>() {
|
||||
activateByEvent(id: string) {
|
||||
activations.push(id);
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// case 1: arguments and retry
|
||||
try {
|
||||
activations.length = 0;
|
||||
await commands.$executeCommand('bazz', [1, 2, { n: 3 }], true);
|
||||
assert.ok(false);
|
||||
} catch (e) {
|
||||
assert.deepEqual(activations, ['onCommand:bazz']);
|
||||
assert.equal((<Error>e).message, '$executeCommand:retry');
|
||||
}
|
||||
|
||||
// case 2: no arguments and retry
|
||||
runs.length = 0;
|
||||
await commands.$executeCommand('bazz', [], true);
|
||||
assert.deepEqual(runs, ['bazz']);
|
||||
|
||||
// case 3: arguments and no retry
|
||||
runs.length = 0;
|
||||
await commands.$executeCommand('bazz', [1, 2, true], false);
|
||||
assert.deepEqual(runs, ['bazz']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ suite('MainThreadDocumentsAndEditors', () => {
|
||||
editorGroupService,
|
||||
null!,
|
||||
new class extends mock<IPanelService>() implements IPanelService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onDidPanelOpen = Event.None;
|
||||
onDidPanelClose = Event.None;
|
||||
getActivePanel() {
|
||||
|
||||
@@ -107,7 +107,7 @@ suite('MainThreadEditors', () => {
|
||||
editorGroupService,
|
||||
bulkEditService,
|
||||
new class extends mock<IPanelService>() implements IPanelService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onDidPanelOpen = Event.None;
|
||||
onDidPanelClose = Event.None;
|
||||
getActivePanel() {
|
||||
|
||||
@@ -25,7 +25,7 @@ export function SingleProxyRPCProtocol(thing: any): IExtHostContext & IExtHostRp
|
||||
|
||||
export class TestRPCProtocol implements IExtHostContext, IExtHostRpcService {
|
||||
|
||||
public _serviceBrand = undefined;
|
||||
public _serviceBrand: undefined;
|
||||
public remoteAuthority = null!;
|
||||
|
||||
private _callCountValue: number = 0;
|
||||
|
||||
@@ -5,13 +5,7 @@
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IColorRegistry, Extensions, ColorContribution } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { editorMarkerNavigationError } from 'vs/editor/contrib/gotoError/gotoErrorWidget';
|
||||
import { overviewRulerModifiedForeground } from 'vs/workbench/contrib/scm/browser/dirtydiffDecorator';
|
||||
import { STATUS_BAR_DEBUGGING_BACKGROUND } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider';
|
||||
import { debugExceptionWidgetBackground } from 'vs/workbench/contrib/debug/browser/exceptionWidget';
|
||||
import { debugToolBarBackground } from 'vs/workbench/contrib/debug/browser/debugToolBar';
|
||||
import { buttonBackground } from 'vs/workbench/contrib/welcome/page/browser/welcomePage';
|
||||
import { embeddedEditorBackground } from 'vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart';
|
||||
|
||||
import { asText } from 'vs/platform/request/common/request';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import * as path from 'vs/base/common/path';
|
||||
@@ -20,6 +14,7 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { RequestService } from 'vs/platform/request/node/requestService';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import 'vs/workbench/workbench.desktop.main';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
|
||||
|
||||
@@ -34,25 +29,25 @@ interface DescriptionDiff {
|
||||
specDescription: string;
|
||||
}
|
||||
|
||||
// add artificial dependencies to some files that are not loaded yet
|
||||
export const forceColorLoad = [editorMarkerNavigationError, overviewRulerModifiedForeground, STATUS_BAR_DEBUGGING_BACKGROUND,
|
||||
debugExceptionWidgetBackground, debugToolBarBackground, buttonBackground, embeddedEditorBackground];
|
||||
|
||||
export const experimental: string[] = []; // 'settings.modifiedItemForeground', 'editorUnnecessary.foreground' ];
|
||||
|
||||
suite('Color Registry', function () {
|
||||
|
||||
test('all colors documented', async function () {
|
||||
const reqContext = await new RequestService(new TestConfigurationService(), new NullLogService()).request({ url: 'https://raw.githubusercontent.com/Microsoft/vscode-docs/vnext/docs/getstarted/theme-color-reference.md' }, CancellationToken.None);
|
||||
test('all colors documented in theme-color.md', async function () {
|
||||
const reqContext = await new RequestService(new TestConfigurationService(), new NullLogService()).request({ url: 'https://raw.githubusercontent.com/microsoft/vscode-docs/vnext/api/references/theme-color.md' }, CancellationToken.None);
|
||||
const content = (await asText(reqContext))!;
|
||||
|
||||
const expression = /\-\s*\`([\w\.]+)\`: (.*)/g;
|
||||
|
||||
let m: RegExpExecArray | null;
|
||||
let colorsInDoc: { [id: string]: ColorInfo } = Object.create(null);
|
||||
let nColorsInDoc = 0;
|
||||
while (m = expression.exec(content)) {
|
||||
colorsInDoc[m[1]] = { description: m[2], offset: m.index, length: m.length };
|
||||
nColorsInDoc++;
|
||||
}
|
||||
assert.ok(nColorsInDoc > 0, 'theme-color.md contains to color descriptions');
|
||||
|
||||
let missing = Object.create(null);
|
||||
let descriptionDiffs: { [id: string]: DescriptionDiff } = Object.create(null);
|
||||
|
||||
@@ -88,7 +83,7 @@ suite('Color Registry', function () {
|
||||
}
|
||||
}
|
||||
|
||||
let undocumentedKeys = Object.keys(missing).map(k => `${k}: ${missing[k]}`);
|
||||
let undocumentedKeys = Object.keys(missing).map(k => `\`${k}\`: ${missing[k]}`);
|
||||
assert.deepEqual(undocumentedKeys, [], 'Undocumented colors ids');
|
||||
|
||||
let superfluousKeys = Object.keys(colorsInDoc);
|
||||
@@ -106,7 +101,7 @@ function getDescription(color: ColorContribution) {
|
||||
}
|
||||
|
||||
async function getColorsFromExtension(): Promise<{ [id: string]: string }> {
|
||||
let extPath = getPathFromAmdModule(require, '../../../../../../extensions');
|
||||
let extPath = getPathFromAmdModule(require, '../../../../../extensions');
|
||||
let extFolders = await pfs.readDirsInDir(extPath);
|
||||
let result: { [id: string]: string } = Object.create(null);
|
||||
for (let folder of extFolders) {
|
||||
|
||||
@@ -160,7 +160,7 @@ suite.skip('QuickOpen performance (integration)', () => {
|
||||
|
||||
class TestTelemetryService implements ITelemetryService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
public isOptedIn = true;
|
||||
|
||||
public events: any[] = [];
|
||||
|
||||
@@ -145,7 +145,7 @@ suite.skip('TextSearch performance (integration)', () => {
|
||||
});
|
||||
|
||||
class TestTelemetryService implements ITelemetryService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
public isOptedIn = true;
|
||||
|
||||
public events: any[] = [];
|
||||
|
||||
@@ -30,10 +30,10 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
|
||||
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
||||
import { ITextFileStreamContent, ITextFileService, IResourceEncoding, IReadTextFileOptions } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IWindowsService, IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult, MenuBarVisibility, IURIToOpen, IOpenSettings, IWindowConfiguration } from 'vs/platform/windows/common/windows';
|
||||
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
@@ -50,7 +50,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { MockContextKeyService, MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
import { ITextBufferFactory, DefaultEndOfLine, EndOfLinePreference, IModelDecorationOptions, ITextModel, ITextSnapshot } from 'vs/editor/common/model';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IConfirmation, IConfirmationResult, IDialogService, IDialogOptions, IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IConfirmation, IConfirmationResult, IDialogService, IDialogOptions, IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, IFileDialogService, IShowResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { IExtensionService, NullExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
@@ -91,10 +91,10 @@ export function createFileInput(instantiationService: IInstantiationService, res
|
||||
return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined);
|
||||
}
|
||||
|
||||
export const TestEnvironmentService = new WorkbenchEnvironmentService(parseArgs(process.argv) as IWindowConfiguration, process.execPath);
|
||||
export const TestEnvironmentService = new WorkbenchEnvironmentService(parseArgs(process.argv, OPTIONS) as IWindowConfiguration, process.execPath);
|
||||
|
||||
export class TestContextService implements IWorkspaceContextService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private workspace: Workspace;
|
||||
private options: any;
|
||||
@@ -106,6 +106,7 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
constructor(workspace: any = TestWorkspace, options: any = null) {
|
||||
this.workspace = workspace;
|
||||
this.options = options || Object.create(null);
|
||||
this._onDidChangeWorkspaceName = new Emitter<void>();
|
||||
this._onDidChangeWorkspaceFolders = new Emitter<IWorkspaceFoldersChangeEvent>();
|
||||
this._onDidChangeWorkbenchState = new Emitter<WorkbenchState>();
|
||||
}
|
||||
@@ -325,7 +326,7 @@ export function workbenchInstantiationService(): IInstantiationService {
|
||||
}
|
||||
|
||||
export class TestDecorationsService implements IDecorationsService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
onDidChangeDecorations: Event<IResourceDecorationChangeEvent> = Event.None;
|
||||
registerDecorationsProvider(_provider: IDecorationsProvider): IDisposable { return Disposable.None; }
|
||||
getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration | undefined { return undefined; }
|
||||
@@ -335,7 +336,7 @@ export class TestExtensionService extends NullExtensionService { }
|
||||
|
||||
export class TestMenuService implements IMenuService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
createMenu(_id: MenuId, _scopedKeybindingService: IContextKeyService): IMenu {
|
||||
return {
|
||||
@@ -348,7 +349,7 @@ export class TestMenuService implements IMenuService {
|
||||
|
||||
export class TestHistoryService implements IHistoryService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
constructor(private root?: URI) {
|
||||
}
|
||||
@@ -392,20 +393,20 @@ export class TestHistoryService implements IHistoryService {
|
||||
|
||||
export class TestDialogService implements IDialogService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public confirm(_confirmation: IConfirmation): Promise<IConfirmationResult> {
|
||||
return Promise.resolve({ confirmed: false });
|
||||
}
|
||||
|
||||
public show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise<number> {
|
||||
return Promise.resolve(0);
|
||||
public show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise<IShowResult> {
|
||||
return Promise.resolve({ choice: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
export class TestFileDialogService implements IFileDialogService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public defaultFilePath(_schemeFilter?: string): URI | undefined {
|
||||
return undefined;
|
||||
@@ -441,7 +442,7 @@ export class TestFileDialogService implements IFileDialogService {
|
||||
|
||||
export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
dimension: IDimension = { width: 800, height: 600 };
|
||||
|
||||
@@ -541,6 +542,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
public addClass(_clazz: string): void { }
|
||||
public removeClass(_clazz: string): void { }
|
||||
|
||||
public getMaximumEditorDimensions(): Dimension { throw new Error('not implemented'); }
|
||||
|
||||
public getWorkbenchContainer(): HTMLElement { throw new Error('not implemented'); }
|
||||
public getWorkbenchElement(): HTMLElement { throw new Error('not implemented'); }
|
||||
|
||||
@@ -558,7 +561,7 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
let activeViewlet: Viewlet = {} as any;
|
||||
|
||||
export class TestViewletService implements IViewletService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
onDidViewletRegisterEmitter = new Emitter<ViewletDescriptor>();
|
||||
onDidViewletDeregisterEmitter = new Emitter<ViewletDescriptor>();
|
||||
@@ -609,7 +612,7 @@ export class TestViewletService implements IViewletService {
|
||||
}
|
||||
|
||||
export class TestPanelService implements IPanelService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
onDidPanelOpen = new Emitter<{ panel: IPanel, focus: boolean }>().event;
|
||||
onDidPanelClose = new Emitter<IPanel>().event;
|
||||
@@ -658,7 +661,7 @@ export class TestStorageService extends InMemoryStorageService { }
|
||||
|
||||
export class TestEditorGroupsService implements IEditorGroupsService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(public groups: TestEditorGroup[] = []) { }
|
||||
|
||||
@@ -858,7 +861,7 @@ export class TestEditorGroup implements IEditorGroupView {
|
||||
|
||||
export class TestEditorService implements EditorServiceImpl {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onDidActiveEditorChange: Event<void> = Event.None;
|
||||
onDidVisibleEditorsChange: Event<void> = Event.None;
|
||||
@@ -908,7 +911,7 @@ export class TestEditorService implements EditorServiceImpl {
|
||||
|
||||
export class TestFileService implements IFileService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private readonly _onFileChanges: Emitter<FileChangesEvent>;
|
||||
private readonly _onAfterOperation: Emitter<FileOperationEvent>;
|
||||
@@ -1079,7 +1082,7 @@ export class TestFileService implements IFileService {
|
||||
}
|
||||
|
||||
export class TestBackupFileService implements IBackupFileService {
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public hasBackups(): Promise<boolean> {
|
||||
return Promise.resolve(false);
|
||||
@@ -1144,7 +1147,7 @@ export class TestBackupFileService implements IBackupFileService {
|
||||
}
|
||||
|
||||
export class TestCodeEditorService implements ICodeEditorService {
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
onCodeEditorAdd: Event<ICodeEditor> = Event.None;
|
||||
onCodeEditorRemove: Event<ICodeEditor> = Event.None;
|
||||
@@ -1170,7 +1173,7 @@ export class TestCodeEditorService implements ICodeEditorService {
|
||||
|
||||
export class TestWindowService implements IWindowService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
onDidChangeFocus: Event<boolean> = new Emitter<boolean>().event;
|
||||
onDidChangeMaximize: Event<boolean>;
|
||||
@@ -1301,7 +1304,7 @@ export class TestWindowService implements IWindowService {
|
||||
|
||||
export class TestLifecycleService implements ILifecycleService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public phase: LifecyclePhase;
|
||||
public startupKind: StartupKind;
|
||||
@@ -1340,7 +1343,7 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
|
||||
export class TestWindowsService implements IWindowsService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public windowCount = 1;
|
||||
|
||||
@@ -1561,7 +1564,7 @@ export class TestWindowsService implements IWindowsService {
|
||||
|
||||
export class TestTextResourceConfigurationService implements ITextResourceConfigurationService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(private configurationService = new TestConfigurationService()) {
|
||||
}
|
||||
@@ -1579,7 +1582,7 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
|
||||
|
||||
export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@@ -1600,7 +1603,7 @@ export class TestTextResourcePropertiesService implements ITextResourcePropertie
|
||||
|
||||
export class TestSharedProcessService implements ISharedProcessService {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
_serviceBrand: undefined;
|
||||
|
||||
getChannel(channelName: string): any {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user