Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)

* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973

* disable strict null check
This commit is contained in:
Anthony Dresser
2019-07-15 22:35:46 -07:00
committed by GitHub
parent f720ec642f
commit 0b7e7ddbf9
2406 changed files with 59140 additions and 35464 deletions

View File

@@ -127,7 +127,7 @@ suite('Workbench base editor', () => {
let oldEditorsCnt = EditorRegistry.getEditors().length;
let oldInputCnt = (<any>EditorRegistry).getEditorInputs().length;
EditorRegistry.registerEditor(d1, new SyncDescriptor(MyInput));
EditorRegistry.registerEditor(d1, [new SyncDescriptor(MyInput)]);
EditorRegistry.registerEditor(d2, [new SyncDescriptor(MyInput), new SyncDescriptor(MyOtherInput)]);
assert.equal(EditorRegistry.getEditors().length, oldEditorsCnt + 2);
@@ -148,8 +148,8 @@ suite('Workbench base editor', () => {
let oldEditors = EditorRegistry.getEditors();
(<any>EditorRegistry).setEditors([]);
EditorRegistry.registerEditor(d2, new SyncDescriptor(ResourceEditorInput));
EditorRegistry.registerEditor(d1, new SyncDescriptor(MyResourceInput));
EditorRegistry.registerEditor(d2, [new SyncDescriptor(ResourceEditorInput)]);
EditorRegistry.registerEditor(d1, [new SyncDescriptor(MyResourceInput)]);
let inst = new TestInstantiationService();
@@ -168,7 +168,7 @@ suite('Workbench base editor', () => {
let oldEditors = EditorRegistry.getEditors();
(<any>EditorRegistry).setEditors([]);
EditorRegistry.registerEditor(d1, new SyncDescriptor(ResourceEditorInput));
EditorRegistry.registerEditor(d1, [new SyncDescriptor(ResourceEditorInput)]);
let inst = new TestInstantiationService();

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { NotificationsModel, NotificationViewItem, INotificationChangeEvent, NotificationChangeType, NotificationViewItemLabelKind } from 'vs/workbench/common/notifications';
import { NotificationsModel, NotificationViewItem, INotificationChangeEvent, NotificationChangeType, NotificationViewItemLabelKind, IStatusMessageChangeEvent, StatusMessageChangeType } from 'vs/workbench/common/notifications';
import { Action } from 'vs/base/common/actions';
import { INotification, Severity } from 'vs/platform/notification/common/notification';
import { createErrorWithActions } from 'vs/base/common/errorsWithActions';
@@ -132,9 +132,14 @@ suite('Notifications', () => {
test('Model', () => {
const model = new NotificationsModel();
let lastEvent!: INotificationChangeEvent;
let lastNotificationEvent!: INotificationChangeEvent;
model.onDidNotificationChange(e => {
lastEvent = e;
lastNotificationEvent = e;
});
let lastStatusMessageEvent!: IStatusMessageChangeEvent;
model.onDidStatusMessageChange(e => {
lastStatusMessageEvent = e;
});
let item1: INotification = { severity: Severity.Error, message: 'Error Message', actions: { primary: [new Action('id', 'label')] } };
@@ -142,23 +147,23 @@ suite('Notifications', () => {
let item2Duplicate: INotification = { severity: Severity.Warning, message: 'Warning Message', source: 'Some Source' };
let item3: INotification = { severity: Severity.Info, message: 'Info Message' };
let item1Handle = model.notify(item1);
assert.equal(lastEvent.item.severity, item1.severity);
assert.equal(lastEvent.item.message.value, item1.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.ADD);
let item1Handle = model.addNotification(item1);
assert.equal(lastNotificationEvent.item.severity, item1.severity);
assert.equal(lastNotificationEvent.item.message.value, item1.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD);
let item2Handle = model.notify(item2);
assert.equal(lastEvent.item.severity, item2.severity);
assert.equal(lastEvent.item.message.value, item2.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.ADD);
let item2Handle = model.addNotification(item2);
assert.equal(lastNotificationEvent.item.severity, item2.severity);
assert.equal(lastNotificationEvent.item.message.value, item2.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD);
model.notify(item3);
assert.equal(lastEvent.item.severity, item3.severity);
assert.equal(lastEvent.item.message.value, item3.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.ADD);
model.addNotification(item3);
assert.equal(lastNotificationEvent.item.severity, item3.severity);
assert.equal(lastNotificationEvent.item.message.value, item3.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD);
assert.equal(model.notifications.length, 3);
@@ -170,29 +175,48 @@ suite('Notifications', () => {
item1Handle.close();
assert.equal(called, 1);
assert.equal(model.notifications.length, 2);
assert.equal(lastEvent.item.severity, item1.severity);
assert.equal(lastEvent.item.message.value, item1.message);
assert.equal(lastEvent.index, 2);
assert.equal(lastEvent.kind, NotificationChangeType.REMOVE);
assert.equal(lastNotificationEvent.item.severity, item1.severity);
assert.equal(lastNotificationEvent.item.message.value, item1.message);
assert.equal(lastNotificationEvent.index, 2);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.REMOVE);
model.notify(item2Duplicate);
model.addNotification(item2Duplicate);
assert.equal(model.notifications.length, 2);
assert.equal(lastEvent.item.severity, item2Duplicate.severity);
assert.equal(lastEvent.item.message.value, item2Duplicate.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.ADD);
assert.equal(lastNotificationEvent.item.severity, item2Duplicate.severity);
assert.equal(lastNotificationEvent.item.message.value, item2Duplicate.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD);
item2Handle.close();
assert.equal(model.notifications.length, 1);
assert.equal(lastEvent.item.severity, item2Duplicate.severity);
assert.equal(lastEvent.item.message.value, item2Duplicate.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.REMOVE);
assert.equal(lastNotificationEvent.item.severity, item2Duplicate.severity);
assert.equal(lastNotificationEvent.item.message.value, item2Duplicate.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.REMOVE);
model.notifications[0].expand();
assert.equal(lastEvent.item.severity, item3.severity);
assert.equal(lastEvent.item.message.value, item3.message);
assert.equal(lastEvent.index, 0);
assert.equal(lastEvent.kind, NotificationChangeType.CHANGE);
assert.equal(lastNotificationEvent.item.severity, item3.severity);
assert.equal(lastNotificationEvent.item.message.value, item3.message);
assert.equal(lastNotificationEvent.index, 0);
assert.equal(lastNotificationEvent.kind, NotificationChangeType.CHANGE);
const disposable = model.showStatusMessage('Hello World');
assert.equal(model.statusMessage!.message, 'Hello World');
assert.equal(lastStatusMessageEvent.item.message, model.statusMessage!.message);
assert.equal(lastStatusMessageEvent.kind, StatusMessageChangeType.ADD);
disposable.dispose();
assert.ok(!model.statusMessage);
assert.equal(lastStatusMessageEvent.kind, StatusMessageChangeType.REMOVE);
let disposable2 = model.showStatusMessage('Hello World 2');
const disposable3 = model.showStatusMessage('Hello World 3');
assert.equal(model.statusMessage!.message, 'Hello World 3');
disposable2.dispose();
assert.equal(model.statusMessage!.message, 'Hello World 3');
disposable3.dispose();
assert.ok(!model.statusMessage);
});
});

View File

@@ -16,10 +16,8 @@ import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/c
import { IModelService } from 'vs/editor/common/services/modelService';
import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguageFeatures';
import { MainThreadLanguageFeatures } from 'vs/workbench/api/browser/mainThreadLanguageFeatures';
import { IHeapService, NullHeapService } from 'vs/workbench/services/heap/common/heap';
import { ExtHostApiCommands } from 'vs/workbench/api/common/extHostApiCommands';
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { ExtHostHeapService } from 'vs/workbench/api/common/extHostHeapService';
import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands';
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
@@ -67,14 +65,14 @@ suite('ExtHostLanguageFeatureCommands', function () {
{
let instantiationService = new TestInstantiationService();
rpcProtocol = new TestRPCProtocol();
instantiationService.stub(IHeapService, NullHeapService);
instantiationService.stub(ICommandService, {
_serviceBrand: undefined,
executeCommand(id: string, args: any): any {
if (!CommandsRegistry.getCommands()[id]) {
const command = CommandsRegistry.getCommands().get(id);
if (!command) {
return Promise.reject(new Error(id + ' NOT known'));
}
let { handler } = CommandsRegistry.getCommands()[id];
const { handler } = command;
return Promise.resolve(instantiationService.invokeFunction(handler, args));
}
});
@@ -109,9 +107,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
const extHostDocuments = new ExtHostDocuments(rpcProtocol, extHostDocumentsAndEditors);
rpcProtocol.set(ExtHostContext.ExtHostDocuments, extHostDocuments);
const heapService = new ExtHostHeapService();
commands = new ExtHostCommands(rpcProtocol, heapService, new NullLogService());
commands = new ExtHostCommands(rpcProtocol, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostCommands, commands);
rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol));
ExtHostApiCommands.register(commands);
@@ -119,7 +115,7 @@ suite('ExtHostLanguageFeatureCommands', function () {
const diagnostics = new ExtHostDiagnostics(rpcProtocol);
rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, diagnostics);
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, heapService, diagnostics, new NullLogService());
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, diagnostics, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, extHost);
mainThread = rpcProtocol.set(MainContext.MainThreadLanguageFeatures, inst.createInstance(MainThreadLanguageFeatures, rpcProtocol));
@@ -801,9 +797,9 @@ suite('ExtHostLanguageFeatureCommands', function () {
}));
await rpcProtocol.sync();
let value = await commands.executeCommand<vscode.SelectionRange[][]>('vscode.executeSelectionRangeProvider', model.uri, [new types.Position(0, 10)]);
let value = await commands.executeCommand<vscode.SelectionRange[]>('vscode.executeSelectionRangeProvider', model.uri, [new types.Position(0, 10)]);
assert.equal(value.length, 1);
assert.ok(value[0].length >= 2);
assert.ok(value[0].parent);
});
});

View File

@@ -26,7 +26,7 @@ suite('ExtHostCommands', function () {
}
};
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined!, new NullLogService());
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), new NullLogService());
commands.registerCommand(true, 'foo', (): any => { }).dispose();
assert.equal(lastUnregister!, 'foo');
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
@@ -46,7 +46,7 @@ suite('ExtHostCommands', function () {
}
};
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined!, new NullLogService());
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), new NullLogService());
const reg = commands.registerCommand(true, 'foo', (): any => { });
reg.dispose();
reg.dispose();

View File

@@ -40,7 +40,7 @@ suite('ExtHostConfiguration', function () {
user: new ConfigurationModel(contents),
workspace: new ConfigurationModel(),
folders: Object.create(null),
configurationScopes: {}
configurationScopes: []
};
}
@@ -138,7 +138,7 @@ suite('ExtHostConfiguration', function () {
testObject = all.getConfiguration('workbench');
actual = testObject.get('colorCustomizations')!;
delete actual['statusBar.foreground'];
actual['statusBar.foreground'] = undefined;
assert.equal(actual['statusBar.foreground'], undefined);
testObject = all.getConfiguration('workbench');
actual = testObject.get('colorCustomizations')!;
@@ -278,7 +278,7 @@ suite('ExtHostConfiguration', function () {
}, ['editor.wordWrap']),
workspace: new ConfigurationModel({}, []),
folders: Object.create(null),
configurationScopes: {}
configurationScopes: []
}
);
@@ -326,7 +326,7 @@ suite('ExtHostConfiguration', function () {
}, ['editor.wordWrap']),
workspace,
folders,
configurationScopes: {}
configurationScopes: []
}
);
@@ -402,7 +402,7 @@ suite('ExtHostConfiguration', function () {
}, ['editor.wordWrap']),
workspace,
folders,
configurationScopes: {}
configurationScopes: []
}
);

View File

@@ -91,18 +91,18 @@ suite('ExtHostDiagnostics', () => {
new Diagnostic(new Range(0, 0, 1, 1), 'message-2')
]);
let array = collection.get(URI.parse('foo:bar'));
let array = collection.get(URI.parse('foo:bar')) as Diagnostic[];
assert.throws(() => array.length = 0);
assert.throws(() => array.pop());
assert.throws(() => array[0] = new Diagnostic(new Range(0, 0, 0, 0), 'evil'));
collection.forEach((uri, array) => {
collection.forEach((uri, array: Diagnostic[]) => {
assert.throws(() => array.length = 0);
assert.throws(() => array.pop());
assert.throws(() => array[0] = new Diagnostic(new Range(0, 0, 0, 0), 'evil'));
});
array = collection.get(URI.parse('foo:bar'));
array = collection.get(URI.parse('foo:bar')) as Diagnostic[];
assert.equal(array.length, 2);
collection.dispose();

View File

@@ -85,7 +85,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
sub.dispose();
assert.ok(event);
assert.throws(() => { event.document = null!; });
assert.throws(() => { (event.document as any) = null!; });
});
});

View File

@@ -18,7 +18,6 @@ import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguage
import { MainThreadLanguageFeatures } from 'vs/workbench/api/browser/mainThreadLanguageFeatures';
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands';
import { IHeapService, NullHeapService } from 'vs/workbench/services/heap/common/heap';
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen';
@@ -37,7 +36,6 @@ import { getDocumentFormattingEditsUntilResult, getDocumentRangeFormattingEditsU
import { getLinks } from 'vs/editor/contrib/links/getLinks';
import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics';
import { ExtHostHeapService } from 'vs/workbench/api/common/extHostHeapService';
import * as vscode from 'vscode';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { NullLogService } from 'vs/platform/log/common/log';
@@ -81,7 +79,6 @@ suite('ExtHostLanguageFeatures', function () {
{
let instantiationService = new TestInstantiationService();
instantiationService.stub(IMarkerService, MarkerService);
instantiationService.stub(IHeapService, NullHeapService);
inst = instantiationService;
}
@@ -102,16 +99,14 @@ suite('ExtHostLanguageFeatures', function () {
const extHostDocuments = new ExtHostDocuments(rpcProtocol, extHostDocumentsAndEditors);
rpcProtocol.set(ExtHostContext.ExtHostDocuments, extHostDocuments);
const heapService = new ExtHostHeapService();
const commands = new ExtHostCommands(rpcProtocol, heapService, new NullLogService());
const commands = new ExtHostCommands(rpcProtocol, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostCommands, commands);
rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol));
const diagnostics = new ExtHostDiagnostics(rpcProtocol);
rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, diagnostics);
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, heapService, diagnostics, new NullLogService());
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, diagnostics, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, extHost);
mainThread = rpcProtocol.set(MainContext.MainThreadLanguageFeatures, inst.createInstance(MainThreadLanguageFeatures, rpcProtocol));
@@ -194,7 +189,7 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
assert.equal(value.lenses.length, 1);
});
test('CodeLens, do not resolve a resolved lens', async () => {
@@ -212,8 +207,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
const data = value[0];
assert.equal(value.lenses.length, 1);
const [data] = value.lenses;
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'id');
assert.equal(symbol!.command!.title, 'Title');
@@ -229,8 +224,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
let data = value[0];
assert.equal(value.lenses.length, 1);
let [data] = value.lenses;
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'missing');
assert.equal(symbol!.command!.title, '!!MISSING: command!!');
@@ -1041,7 +1036,9 @@ suite('ExtHostLanguageFeatures', function () {
disposables.push(extHost.registerDocumentLinkProvider(defaultExtension, defaultSelector, new class implements vscode.DocumentLinkProvider {
provideDocumentLinks() {
return [new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'))];
const link = new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'));
link.tooltip = 'tooltip';
return [link];
}
}));
@@ -1051,6 +1048,7 @@ suite('ExtHostLanguageFeatures', function () {
let [first] = links;
assert.equal(first.url, 'foo:bar#3');
assert.deepEqual(first.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 2, endColumn: 2 });
assert.equal(first.tooltip, 'tooltip');
});
test('Links, evil provider', async () => {

View File

@@ -6,9 +6,11 @@
import * as assert from 'assert';
import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMessageService';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification';
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';
@@ -30,7 +32,7 @@ const emptyCommandService: ICommandService = {
};
const emptyNotificationService = new class implements INotificationService {
_serviceBrand: 'notificiationService';
_serviceBrand: ServiceIdentifier<INotificationService>;
notify(...args: any[]): never {
throw new Error('not implemented');
}
@@ -46,11 +48,13 @@ const emptyNotificationService = new class implements INotificationService {
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
throw new Error('not implemented');
}
status(message: string | Error, options?: IStatusMessageOptions): IDisposable {
return Disposable.None;
}
};
class EmptyNotificationService implements INotificationService {
_serviceBrand: any;
_serviceBrand: ServiceIdentifier<INotificationService>;
constructor(private withNotify: (notification: INotification) => void) {
}
@@ -72,6 +76,9 @@ class EmptyNotificationService implements INotificationService {
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
throw new Error('not implemented');
}
status(message: string, options?: IStatusMessageOptions): IDisposable {
return Disposable.None;
}
}
suite('ExtHostMessageService', function () {

View File

@@ -7,7 +7,7 @@ import * as assert from 'assert';
import { mapArrayOrNot } from 'vs/base/common/arrays';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { dispose } from 'vs/base/common/lifecycle';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { joinPath } from 'vs/base/common/resources';
import { URI, UriComponents } from 'vs/base/common/uri';
import * as pfs from 'vs/base/node/pfs';
@@ -16,12 +16,12 @@ import { ExtHostSearch } from 'vs/workbench/api/node/extHostSearch';
import { Range } from 'vs/workbench/api/common/extHostTypes';
import { IFileMatch, IFileQuery, IPatternInfo, IRawFileMatch2, ISearchCompleteStats, ISearchQuery, ITextQuery, QueryType, resultIsMatch } from 'vs/workbench/services/search/common/search';
import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
import { TestLogService } from 'vs/workbench/test/workbenchTestServices';
import * as vscode from 'vscode';
import { NullLogService } from 'vs/platform/log/common/log';
let rpcProtocol: TestRPCProtocol;
let extHostSearch: ExtHostSearch;
let disposables: vscode.Disposable[] = [];
const disposables = new DisposableStore();
let mockMainThreadSearch: MockMainThreadSearch;
class MockMainThreadSearch implements MainThreadSearchShape {
@@ -63,12 +63,12 @@ export function extensionResultIsMatch(data: vscode.TextSearchResult): data is v
suite('ExtHostSearch', () => {
async function registerTestTextSearchProvider(provider: vscode.TextSearchProvider, scheme = 'file'): Promise<void> {
disposables.push(extHostSearch.registerTextSearchProvider(scheme, provider));
disposables.add(extHostSearch.registerTextSearchProvider(scheme, provider));
await rpcProtocol.sync();
}
async function registerTestFileSearchProvider(provider: vscode.FileSearchProvider, scheme = 'file'): Promise<void> {
disposables.push(extHostSearch.registerFileSearchProvider(scheme, provider));
disposables.add(extHostSearch.registerFileSearchProvider(scheme, provider));
await rpcProtocol.sync();
}
@@ -130,7 +130,7 @@ suite('ExtHostSearch', () => {
rpcProtocol = new TestRPCProtocol();
mockMainThreadSearch = new MockMainThreadSearch();
const logService = new TestLogService();
const logService = new NullLogService();
rpcProtocol.set(MainContext.MainThreadSearch, mockMainThreadSearch);
@@ -139,7 +139,7 @@ suite('ExtHostSearch', () => {
});
teardown(() => {
dispose(disposables);
disposables.clear();
return rpcProtocol.sync();
});

View File

@@ -11,7 +11,6 @@ import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { MainThreadTreeViewsShape, MainContext } from 'vs/workbench/api/common/extHost.protocol';
import { TreeDataProvider, TreeItem } from 'vscode';
import { TestRPCProtocol } from './testRPCProtocol';
import { ExtHostHeapService } from 'vs/workbench/api/common/extHostHeapService';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -72,7 +71,7 @@ suite('ExtHostTreeView', function () {
rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol));
target = new RecordingShape();
testObject = new ExtHostTreeViews(target, new ExtHostCommands(rpcProtocol, new ExtHostHeapService(), new NullLogService()), new NullLogService());
testObject = new ExtHostTreeViews(target, new ExtHostCommands(rpcProtocol, new NullLogService()), new NullLogService());
onDidChangeTreeNode = new Emitter<{ key: string }>();
onDidChangeTreeNodeWithId = new Emitter<{ key: string }>();
testObject.createTreeView('testNodeTreeProvider', { treeDataProvider: aNodeTreeDataProvider() }, { enableProposedApi: true } as IExtensionDescription);

View File

@@ -31,6 +31,7 @@ suite('ExtHostTypes', function () {
scheme: 'file',
path: '/path/test.file',
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
_sep: isWindows ? 1 : undefined,
});
assert.ok(uri.toString());
@@ -39,6 +40,7 @@ suite('ExtHostTypes', function () {
scheme: 'file',
path: '/path/test.file',
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
_sep: isWindows ? 1 : undefined,
external: 'file:///path/test.file'
});
});

View File

@@ -4,20 +4,21 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { MainThreadWebviews } from 'vs/workbench/api/electron-browser/mainThreadWebview';
import { MainThreadWebviews } from 'vs/workbench/api/browser/mainThreadWebview';
import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview';
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
import * as vscode from 'vscode';
import { SingleProxyRPCProtocol } from './testRPCProtocol';
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import { URI } from 'vs/base/common/uri';
suite('ExtHostWebview', function () {
suite('ExtHostWebview', () => {
test('Cannot register multiple serializers for the same view type', async () => {
const viewType = 'view.type';
const shape = createNoopMainThreadWebviews();
const extHostWebviews = new ExtHostWebviews(SingleProxyRPCProtocol(shape));
const extHostWebviews = new ExtHostWebviews(SingleProxyRPCProtocol(shape), { webviewCspSource: '', webviewResourceRoot: '' });
let lastInvokedDeserializer: vscode.WebviewPanelSerializer | undefined = undefined;
@@ -46,11 +47,95 @@ suite('ExtHostWebview', function () {
await extHostWebviews.$deserializeWebviewPanel('x', viewType, 'title', {}, 0 as EditorViewColumn, {});
assert.strictEqual(lastInvokedDeserializer, serializerB);
});
test('toWebviewResource for desktop vscode-resource scheme', () => {
const shape = createNoopMainThreadWebviews();
const extHostWebviews = new ExtHostWebviews(SingleProxyRPCProtocol(shape), {
webviewCspSource: '',
webviewResourceRoot: 'vscode-resource:{{resource}}'
});
const webview = extHostWebviews.createWebviewPanel({} as any, 'type', 'title', 1, {});
assert.strictEqual(
webview.webview.toWebviewResource(URI.parse('file:///Users/codey/file.html')).toString(),
'vscode-resource:/Users/codey/file.html',
'Unix basic'
);
assert.strictEqual(
webview.webview.toWebviewResource(URI.parse('file:///Users/codey/file.html#frag')).toString(),
'vscode-resource:/Users/codey/file.html#frag',
'Unix should preserve fragment'
);
assert.strictEqual(
webview.webview.toWebviewResource(URI.parse('file:///Users/codey/f%20ile.html')).toString(),
'vscode-resource:/Users/codey/f%20ile.html',
'Unix with encoding'
);
assert.strictEqual(
webview.webview.toWebviewResource(URI.parse('file://localhost/Users/codey/file.html')).toString(),
'vscode-resource://localhost/Users/codey/file.html',
'Unix should preserve authority'
);
assert.strictEqual(
webview.webview.toWebviewResource(URI.parse('file:///c:/codey/file.txt')).toString(),
'vscode-resource:/c%3A/codey/file.txt',
'Windows C drive'
);
});
test('toWebviewResource for web endpoint', () => {
const shape = createNoopMainThreadWebviews();
const extHostWebviews = new ExtHostWebviews(SingleProxyRPCProtocol(shape), {
webviewCspSource: '',
webviewResourceRoot: `https://{{uuid}}.webview.contoso.com/commit{{resource}}`
});
const webview = extHostWebviews.createWebviewPanel({} as any, 'type', 'title', 1, {});
function stripEndpointUuid(input: string) {
return input.replace(/^https:\/\/[^\.]+?\./, '');
}
assert.strictEqual(
stripEndpointUuid(webview.webview.toWebviewResource(URI.parse('file:///Users/codey/file.html')).toString()),
'webview.contoso.com/commit///Users/codey/file.html',
'Unix basic'
);
assert.strictEqual(
stripEndpointUuid(webview.webview.toWebviewResource(URI.parse('file:///Users/codey/file.html#frag')).toString()),
'webview.contoso.com/commit///Users/codey/file.html#frag',
'Unix should preserve fragment'
);
assert.strictEqual(
stripEndpointUuid(webview.webview.toWebviewResource(URI.parse('file:///Users/codey/f%20ile.html')).toString()),
'webview.contoso.com/commit///Users/codey/f%20ile.html',
'Unix with encoding'
);
assert.strictEqual(
stripEndpointUuid(webview.webview.toWebviewResource(URI.parse('file://localhost/Users/codey/file.html')).toString()),
'webview.contoso.com/commit//localhost/Users/codey/file.html',
'Unix should preserve authority'
);
assert.strictEqual(
stripEndpointUuid(webview.webview.toWebviewResource(URI.parse('file:///c:/codey/file.txt')).toString()),
'webview.contoso.com/commit///c%3A/codey/file.txt',
'Windows C drive'
);
});
});
function createNoopMainThreadWebviews() {
return new class extends mock<MainThreadWebviews>() {
$createWebviewPanel() { /* noop */ }
$registerSerializer() { /* noop */ }
$unregisterSerializer() { /* noop */ }
};

View File

@@ -62,7 +62,7 @@ suite('MainThreadEditors', () => {
}
move(source: URI, target: URI) {
movedResources.set(source, target);
return Promise.resolve(undefined);
return Promise.resolve(Object.create(null));
}
models = <any>{
onModelSaved: Event.None,

View File

@@ -12,12 +12,15 @@ import { debugExceptionWidgetBackground } from 'vs/workbench/contrib/debug/brows
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 { request, asText } from 'vs/base/node/request';
import { asText } from 'vs/platform/request/common/request';
import * as pfs from 'vs/base/node/pfs';
import * as path from 'vs/base/common/path';
import * as assert from 'assert';
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 { NullLogService } from 'vs/platform/log/common/log';
interface ColorInfo {
@@ -40,7 +43,7 @@ export const experimental: string[] = []; // 'settings.modifiedItemForeground',
suite('Color Registry', function () {
test('all colors documented', async function () {
const reqContext = await request({ url: 'https://raw.githubusercontent.com/Microsoft/vscode-docs/vnext/docs/getstarted/theme-color-reference.md' }, CancellationToken.None);
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);
const content = (await asText(reqContext))!;
const expression = /\-\s*\`([\w\.]+)\`: (.*)/g;

View File

@@ -26,9 +26,10 @@ import { Extensions, IQuickOpenRegistry } from 'vs/workbench/browser/quickopen';
import 'vs/workbench/contrib/search/browser/search.contribution'; // load contributions
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { SearchService } from 'vs/workbench/services/search/node/searchService';
import { LocalSearchService } from 'vs/workbench/services/search/node/searchService';
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { TestContextService, TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
namespace Timer {
export interface ITimerEvent {
@@ -78,7 +79,7 @@ suite.skip('QuickOpen performance (integration)', () => {
[IEditorGroupsService, new TestEditorGroupsService()],
[IEnvironmentService, TestEnvironmentService],
[IUntitledEditorService, createSyncDescriptor(UntitledEditorService)],
[ISearchService, createSyncDescriptor(SearchService)]
[ISearchService, createSyncDescriptor(LocalSearchService)]
));
const registry = Registry.as<IQuickOpenRegistry>(Extensions.Quickopen);
@@ -172,6 +173,10 @@ class TestTelemetryService implements ITelemetryService {
return Promise.resolve(undefined);
}
public publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>) {
return this.publicLog(eventName, data as any);
}
public getTelemetryInfo(): Promise<ITelemetryInfo> {
return Promise.resolve({
instanceId: 'someValue.instanceId',

View File

@@ -15,7 +15,7 @@ import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/serv
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import * as minimist from 'minimist';
import * as path from 'vs/base/common/path';
import { SearchService } from 'vs/workbench/services/search/node/searchService';
import { LocalSearchService } from 'vs/workbench/services/search/node/searchService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { TestEnvironmentService, TestContextService, TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
@@ -33,6 +33,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { NullLogService, ILogService } from 'vs/platform/log/common/log';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
declare var __dirname: string;
@@ -68,7 +69,7 @@ suite.skip('TextSearch performance (integration)', () => {
[IEditorGroupsService, new TestEditorGroupsService()],
[IEnvironmentService, TestEnvironmentService],
[IUntitledEditorService, createSyncDescriptor(UntitledEditorService)],
[ISearchService, createSyncDescriptor(SearchService)],
[ISearchService, createSyncDescriptor(LocalSearchService)],
[ILogService, new NullLogService()]
));
@@ -165,6 +166,10 @@ class TestTelemetryService implements ITelemetryService {
return Promise.resolve();
}
public publicLog2<E extends ClassifiedEvent<T> = never, T extends GDPRClassification<T> = never>(eventName: string, data?: StrictPropertyCheck<T, E>) {
return this.publicLog(eventName, data as any);
}
public getTelemetryInfo(): Promise<ITelemetryInfo> {
return Promise.resolve({
instanceId: 'someValue.instanceId',

View File

@@ -38,7 +38,7 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/
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';
import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
@@ -64,14 +64,14 @@ import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon';
import { EditorGroup } from 'vs/workbench/common/editor/editorGroup';
import { Dimension } from 'vs/base/browser/dom';
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
import { ILabelService } from 'vs/platform/label/common/label';
import { timeout } from 'vs/base/common/async';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { ViewletDescriptor, Viewlet } from 'vs/workbench/browser/viewlet';
import { IViewlet } from 'vs/workbench/common/viewlet';
import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage';
import { isLinux, isMacintosh } from 'vs/base/common/platform';
import { isLinux, isMacintosh, IProcessEnvironment } from 'vs/base/common/platform';
import { LabelService } from 'vs/workbench/services/label/common/labelService';
import { IDimension } from 'vs/platform/layout/browser/layoutService';
import { Part } from 'vs/workbench/browser/part';
@@ -82,7 +82,7 @@ import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedPr
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { WorkbenchEnvironmentService } from 'vs/workbench/services/environment/node/environmentService';
import { VSBuffer, VSBufferReadable } from 'vs/base/common/buffer';
import { BrowserTextFileService } from 'vs/workbench/services/textfile/browser/textFileService';
import { NodeTextFileService } from 'vs/workbench/services/textfile/node/textFileService';
import { Schemas } from 'vs/base/common/network';
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
@@ -177,7 +177,7 @@ export class TestContextService implements IWorkspaceContextService {
}
}
export class TestTextFileService extends BrowserTextFileService {
export class TestTextFileService extends NodeTextFileService {
public cleanupBackupsBeforeShutdownCalled: boolean;
private promptPath: URI;
@@ -311,7 +311,7 @@ export function workbenchInstantiationService(): IInstantiationService {
instantiationService.stub(ITextFileService, <ITextFileService>instantiationService.createInstance(TestTextFileService));
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
instantiationService.stub(IThemeService, new TestThemeService());
instantiationService.stub(ILogService, new TestLogService());
instantiationService.stub(ILogService, new NullLogService());
instantiationService.stub(IEditorGroupsService, new TestEditorGroupsService([new TestEditorGroup(0)]));
instantiationService.stub(ILabelService, <ILabelService>instantiationService.createInstance(LabelService));
const editorService = new TestEditorService();
@@ -322,19 +322,6 @@ export function workbenchInstantiationService(): IInstantiationService {
return instantiationService;
}
export class TestLogService implements ILogService {
_serviceBrand: any; onDidChangeLogLevel: Event<LogLevel>;
getLevel(): LogLevel { return LogLevel.Info; }
setLevel(_level: LogLevel): void { }
trace(_message: string, ..._args: any[]): void { }
debug(_message: string, ..._args: any[]): void { }
info(_message: string, ..._args: any[]): void { }
warn(_message: string, ..._args: any[]): void { }
error(_message: string | Error, ..._args: any[]): void { }
critical(_message: string | Error, ..._args: any[]): void { }
dispose(): void { }
}
export class TestDecorationsService implements IDecorationsService {
_serviceBrand: any;
onDidChangeDecorations: Event<IResourceDecorationChangeEvent> = Event.None;
@@ -439,6 +426,9 @@ export class TestFileDialogService implements IFileDialogService {
public pickWorkspaceAndOpen(_options: IPickAndOpenOptions): Promise<any> {
return Promise.resolve(0);
}
public pickFileToSave(_options: ISaveDialogOptions): Promise<URI | undefined> {
return Promise.resolve(undefined);
}
public showSaveDialog(_options: ISaveDialogOptions): Promise<URI | undefined> {
return Promise.resolve(undefined);
}
@@ -456,6 +446,9 @@ export class TestLayoutService implements IWorkbenchLayoutService {
container: HTMLElement = window.document.body;
onZenModeChange: Event<boolean> = Event.None;
onCenteredLayoutChange: Event<boolean> = Event.None;
onFullscreenChange: Event<boolean> = Event.None;
onPanelPositionChange: Event<string> = Event.None;
onLayout = Event.None;
private _onTitleBarVisibilityChange = new Emitter<void>();
@@ -541,6 +534,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
public addClass(_clazz: string): void { }
public removeClass(_clazz: string): void { }
public getWorkbenchContainer(): HTMLElement { throw new Error('not implemented'); }
public getWorkbenchElement(): HTMLElement { throw new Error('not implemented'); }
public toggleZenMode(): void { }
@@ -617,6 +612,10 @@ export class TestPanelService implements IPanelService {
return null!;
}
public getPanel(id: string): any {
return activeViewlet;
}
public getPanels(): any[] {
return [];
}
@@ -638,6 +637,10 @@ export class TestPanelService implements IPanelService {
throw new Error('Method not implemented.');
}
public getProgressIndicator(id: string) {
return null!;
}
public hideActivePanel(): void { }
public getLastActivePanelId(): string {
@@ -700,11 +703,11 @@ export class TestEditorGroupsService implements IEditorGroupsService {
throw new Error('not implemented');
}
getSize(_group: number | IEditorGroup): number {
return 100;
getSize(_group: number | IEditorGroup): { width: number, height: number } {
return { width: 100, height: 100 };
}
setSize(_group: number | IEditorGroup, _size: number): void { }
setSize(_group: number | IEditorGroup, _size: { width: number, height: number }): void { }
arrangeGroups(_arrangement: GroupsArrangement): void { }
@@ -1072,6 +1075,10 @@ export class TestBackupFileService implements IBackupFileService {
return Promise.resolve(false);
}
public hasBackupSync(resource: URI, versionId?: number): boolean {
return false;
}
public loadBackupResource(resource: URI): Promise<URI | undefined> {
return this.hasBackup(resource).then(hasBackup => {
if (hasBackup) {
@@ -1217,6 +1224,14 @@ export class TestWindowService implements IWindowService {
});
}
addRecentlyOpened(_recents: IRecent[]): Promise<void> {
return Promise.resolve();
}
removeFromRecentlyOpened(_paths: URI[]): Promise<void> {
return Promise.resolve();
}
focusWindow(): Promise<void> {
return Promise.resolve();
}
@@ -1446,6 +1461,10 @@ export class TestWindowsService implements IWindowsService {
return Promise.resolve();
}
openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise<void> {
return Promise.resolve();
}
getWindows(): Promise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> {
throw new Error('not implemented');
}
@@ -1576,30 +1595,6 @@ export class TestSharedProcessService implements ISharedProcessService {
registerChannel(channelName: string, channel: any): void { }
}
export class NullFileSystemProvider implements IFileSystemProvider {
capabilities: FileSystemProviderCapabilities = FileSystemProviderCapabilities.Readonly;
onDidChangeCapabilities: Event<void> = Event.None;
onDidChangeFile: Event<IFileChange[]> = Event.None;
constructor(private disposableFactory: () => IDisposable = () => Disposable.None) { }
watch(resource: URI, opts: IWatchOptions): IDisposable { return this.disposableFactory(); }
stat(resource: URI): Promise<IStat> { return Promise.resolve(undefined!); }
mkdir(resource: URI): Promise<void> { return Promise.resolve(undefined!); }
readdir(resource: URI): Promise<[string, FileType][]> { return Promise.resolve(undefined!); }
delete(resource: URI, opts: FileDeleteOptions): Promise<void> { return Promise.resolve(undefined!); }
rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void> { return Promise.resolve(undefined!); }
copy?(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void> { return Promise.resolve(undefined!); }
readFile?(resource: URI): Promise<Uint8Array> { return Promise.resolve(undefined!); }
writeFile?(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise<void> { return Promise.resolve(undefined!); }
open?(resource: URI, opts: FileOpenOptions): Promise<number> { return Promise.resolve(undefined!); }
close?(fd: number): Promise<void> { return Promise.resolve(undefined!); }
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number> { return Promise.resolve(undefined!); }
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number> { return Promise.resolve(undefined!); }
}
export class RemoteFileSystemProvider implements IFileSystemProvider {
constructor(private readonly diskFileSystemProvider: IFileSystemProvider, private readonly remoteAuthority: string) { }