From 2420d4c505bc37a8e6224a6a50b30e9bdd3edb82 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 7 Aug 2019 19:51:28 +0200 Subject: [PATCH] separate rpc and init data into separate services --- .../workbench/api/common/extHostCommands.ts | 6 ++--- .../api/common/extHostConfiguration.ts | 6 ++--- .../api/common/extHostDecorations.ts | 6 ++--- .../api/common/extHostDocumentsAndEditors.ts | 8 +++--- ...xtService.ts => extHostInitDataService.ts} | 16 +++--------- src/vs/workbench/api/common/extHostOutput.ts | 6 ++--- .../workbench/api/common/extHostWorkspace.ts | 12 +++++---- src/vs/workbench/api/common/rpcService.ts | 25 +++++++++++++++++++ .../api/node/extHostExtensionService.ts | 9 ++++--- .../api/node/extHostOutputService.ts | 12 ++++++--- src/vs/workbench/api/node/extHostTask.ts | 25 ++++++++++--------- .../api/node/extHostTerminalService.ts | 6 ++--- .../extensions/node/extensionHostMain.ts | 11 +++++--- .../api/extHostApiCommands.test.ts | 18 ++++++------- .../api/extHostCommands.test.ts | 7 +++--- .../api/extHostConfiguration.test.ts | 9 +++---- .../extHostDocumentSaveParticipant.test.ts | 6 ++--- .../api/extHostDocumentsAndEditors.test.ts | 14 ++--------- .../api/extHostLanguageFeatures.test.ts | 9 +++---- .../api/extHostTextEditors.test.ts | 6 ++--- .../api/extHostTreeViews.test.ts | 5 ++-- .../api/extHostWorkspace.test.ts | 14 ++++++----- .../electron-browser/api/testRPCProtocol.ts | 7 ++++-- 23 files changed, 124 insertions(+), 119 deletions(-) rename src/vs/workbench/api/common/{extHostContextService.ts => extHostInitDataService.ts} (51%) create mode 100644 src/vs/workbench/api/common/rpcService.ts diff --git a/src/vs/workbench/api/common/extHostCommands.ts b/src/vs/workbench/api/common/extHostCommands.ts index 3ab2fdbf2fc..b0219c67096 100644 --- a/src/vs/workbench/api/common/extHostCommands.ts +++ b/src/vs/workbench/api/common/extHostCommands.ts @@ -19,8 +19,8 @@ import { Position } from 'vs/editor/common/core/position'; import { URI } from 'vs/base/common/uri'; import { Event, Emitter } from 'vs/base/common/event'; import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; interface CommandHandler { callback: Function; @@ -46,10 +46,10 @@ export class ExtHostCommands implements ExtHostCommandsShape { private readonly _argumentProcessors: ArgumentProcessor[]; constructor( - @IExtHostContextService extHostContext: IExtHostContextService, + @IExtHostRpcService extHostRpc: IExtHostRpcService, @ILogService logService: ILogService ) { - this._proxy = extHostContext.rpc.getProxy(MainContext.MainThreadCommands); + this._proxy = extHostRpc.getProxy(MainContext.MainThreadCommands); this._onDidExecuteCommand = new Emitter({ onFirstListenerDidAdd: () => this._proxy.$registerCommandListener(), onLastListenerRemove: () => this._proxy.$unregisterCommandListener(), diff --git a/src/vs/workbench/api/common/extHostConfiguration.ts b/src/vs/workbench/api/common/extHostConfiguration.ts index 32f8db76d64..bebd81571fc 100644 --- a/src/vs/workbench/api/common/extHostConfiguration.ts +++ b/src/vs/workbench/api/common/extHostConfiguration.ts @@ -18,8 +18,8 @@ import { ConfigurationScope, OVERRIDE_PROPERTY_PATTERN } from 'vs/platform/confi import { isObject } from 'vs/base/common/types'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { Barrier } from 'vs/base/common/async'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; function lookUp(tree: any, key: string) { if (key) { @@ -50,10 +50,10 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { private _actual: ExtHostConfigProvider | null; constructor( - @IExtHostContextService extHostContext: IExtHostContextService, + @IExtHostRpcService extHostRpc: IExtHostRpcService, @IExtHostWorkspace extHostWorkspace: IExtHostWorkspace ) { - this._proxy = extHostContext.rpc.getProxy(MainContext.MainThreadConfiguration); + this._proxy = extHostRpc.getProxy(MainContext.MainThreadConfiguration); this._extHostWorkspace = extHostWorkspace; this._barrier = new Barrier(); this._actual = null; diff --git a/src/vs/workbench/api/common/extHostDecorations.ts b/src/vs/workbench/api/common/extHostDecorations.ts index 6d964143779..37b57b9de13 100644 --- a/src/vs/workbench/api/common/extHostDecorations.ts +++ b/src/vs/workbench/api/common/extHostDecorations.ts @@ -11,7 +11,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { asArray } from 'vs/base/common/arrays'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; interface ProviderData { provider: vscode.DecorationProvider; @@ -27,9 +27,9 @@ export class ExtHostDecorations implements IExtHostDecorations { private readonly _proxy: MainThreadDecorationsShape; constructor( - @IExtHostContextService contextService: IExtHostContextService, + @IExtHostRpcService extHostRpc: IExtHostRpcService, ) { - this._proxy = contextService.rpc.getProxy(MainContext.MainThreadDecorations); + this._proxy = extHostRpc.getProxy(MainContext.MainThreadDecorations); } registerDecorationProvider(provider: vscode.DecorationProvider, extensionId: ExtensionIdentifier): vscode.Disposable { diff --git a/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts b/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts index 0f31898cb3a..6a5762373ec 100644 --- a/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts +++ b/src/vs/workbench/api/common/extHostDocumentsAndEditors.ts @@ -12,8 +12,8 @@ import { ExtHostDocumentData } from 'vs/workbench/api/common/extHostDocumentData import { ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor'; import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; import { Disposable } from 'vs/workbench/api/common/extHostTypes'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsShape { @@ -37,7 +37,7 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha readonly onDidChangeActiveTextEditor: Event = this._onDidChangeActiveTextEditor.event; constructor( - @IExtHostContextService private readonly _ctx: IExtHostContextService, + @IExtHostRpcService private readonly _extHostRpc: IExtHostRpcService, ) { } dispose() { @@ -68,7 +68,7 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha assert.ok(!this._documents.has(resource.toString()), `document '${resource} already exists!'`); const documentData = new ExtHostDocumentData( - this._ctx.rpc.getProxy(MainContext.MainThreadDocuments), + this._extHostRpc.getProxy(MainContext.MainThreadDocuments), resource, data.lines, data.EOL, @@ -99,7 +99,7 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha const documentData = this._documents.get(resource.toString())!; const editor = new ExtHostTextEditor( - this._ctx.rpc.getProxy(MainContext.MainThreadTextEditors), + this._extHostRpc.getProxy(MainContext.MainThreadTextEditors), data.id, documentData, data.selections.map(typeConverters.Selection.to), diff --git a/src/vs/workbench/api/common/extHostContextService.ts b/src/vs/workbench/api/common/extHostInitDataService.ts similarity index 51% rename from src/vs/workbench/api/common/extHostContextService.ts rename to src/vs/workbench/api/common/extHostInitDataService.ts index 77094e73009..2f0acd57a3c 100644 --- a/src/vs/workbench/api/common/extHostContextService.ts +++ b/src/vs/workbench/api/common/extHostInitDataService.ts @@ -3,22 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMainContext, IInitData } from './extHost.protocol'; +import { IInitData } from './extHost.protocol'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -export const IExtHostContextService = createDecorator('IExtHostContextService'); +export const IExtHostInitDataService = createDecorator('IExtHostInitDataService'); -export interface IExtHostContextService { +export interface IExtHostInitDataService extends Readonly { _serviceBrand: undefined; - - readonly rpc: IMainContext; - readonly initData: IInitData; } -export class ExtHostContextService implements IExtHostContextService { - _serviceBrand: any; - constructor( - readonly rpc: IMainContext, - readonly initData: IInitData - ) { } -} diff --git a/src/vs/workbench/api/common/extHostOutput.ts b/src/vs/workbench/api/common/extHostOutput.ts index 91466ccaf92..78aca487bf8 100644 --- a/src/vs/workbench/api/common/extHostOutput.ts +++ b/src/vs/workbench/api/common/extHostOutput.ts @@ -10,7 +10,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; import { VSBuffer } from 'vs/base/common/buffer'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; export abstract class AbstractExtHostOutputChannel extends Disposable implements vscode.OutputChannel { @@ -143,8 +143,8 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape { protected readonly _channels: Map = new Map(); protected readonly _visibleChannelDisposable = new MutableDisposable(); - constructor(@IExtHostContextService extHostContext: IExtHostContextService) { - this._proxy = extHostContext.rpc.getProxy(MainContext.MainThreadOutputService); + constructor(@IExtHostRpcService extHostRpc: IExtHostRpcService) { + this._proxy = extHostRpc.getProxy(MainContext.MainThreadOutputService); } $setVisibleChannel(channelId: string): void { diff --git a/src/vs/workbench/api/common/extHostWorkspace.ts b/src/vs/workbench/api/common/extHostWorkspace.ts index fa066e18686..e0b0b2006d6 100644 --- a/src/vs/workbench/api/common/extHostWorkspace.ts +++ b/src/vs/workbench/api/common/extHostWorkspace.ts @@ -25,8 +25,9 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio import { Barrier } from 'vs/base/common/async'; import { Schemas } from 'vs/base/common/network'; import { withUndefinedAsNull } from 'vs/base/common/types'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; export interface IExtHostWorkspaceProvider { getWorkspaceFolder2(uri: vscode.Uri, resolveParent?: boolean): Promise; @@ -173,16 +174,17 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac private readonly _activeSearchCallbacks: ((match: IRawFileMatch2) => any)[] = []; constructor( - @IExtHostContextService extHostContext: IExtHostContextService, + @IExtHostRpcService extHostRpc: IExtHostRpcService, + @IExtHostInitDataService initData: IExtHostInitDataService, @ILogService logService: ILogService, ) { this._logService = logService; this._requestIdProvider = new Counter(); this._barrier = new Barrier(); - this._proxy = extHostContext.rpc.getProxy(MainContext.MainThreadWorkspace); - this._messageService = extHostContext.rpc.getProxy(MainContext.MainThreadMessageService); - const data = extHostContext.initData.workspace; + this._proxy = extHostRpc.getProxy(MainContext.MainThreadWorkspace); + this._messageService = extHostRpc.getProxy(MainContext.MainThreadMessageService); + const data = initData.workspace; this._confirmedWorkspace = data ? new ExtHostWorkspaceImpl(data.id, data.name, [], data.configuration ? URI.revive(data.configuration) : null, !!data.isUntitled) : undefined; } diff --git a/src/vs/workbench/api/common/rpcService.ts b/src/vs/workbench/api/common/rpcService.ts new file mode 100644 index 00000000000..5cff20d4006 --- /dev/null +++ b/src/vs/workbench/api/common/rpcService.ts @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IMainContext } from 'vs/workbench/api/common/extHost.protocol'; +import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; + +export const IExtHostRpcService = createDecorator('IExtHostRpcService'); + +export interface IExtHostRpcService { + _serviceBrand: any; + getProxy(identifier: ProxyIdentifier): T; +} + +export class ExtHostRpcService implements IExtHostRpcService { + readonly _serviceBrand: any; + + constructor(private readonly _mainContext: IMainContext) { } + + getProxy(identifier: ProxyIdentifier): T { + return this._mainContext.getProxy(identifier); + } +} diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index faafb11b7fe..0d1c9447fc6 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -35,7 +35,7 @@ import { RemoteAuthorityResolverError, ExtensionExecutionContext } from 'vs/work import { IURITransformer } from 'vs/base/common/uriIpc'; import { ResolvedAuthority, ResolvedOptions } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; interface ITestRunner { /** Old test runner API, as exported from `vscode/lib/testrunner` */ @@ -99,15 +99,16 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { constructor( hostUtils: IHostUtils, uriTransformer: IURITransformer | null, + extHostContext: IMainContext, @IInstantiationService instaService: IInstantiationService, - @IExtHostContextService extHostContext: IExtHostContextService, @IExtHostWorkspace extHostWorkspace: IExtHostWorkspace, @IExtHostConfiguration extHostConfiguration: IExtHostConfiguration, @ILogService extHostLogService: ExtHostLogService, + @IExtHostInitDataService initData: IExtHostInitDataService ) { this._hostUtils = hostUtils; - this._initData = extHostContext.initData; - this._extHostContext = extHostContext.rpc; + this._extHostContext = extHostContext; + this._initData = initData; this._instaService = instaService; this._extHostWorkspace = extHostWorkspace; this._extHostConfiguration = extHostConfiguration; diff --git a/src/vs/workbench/api/node/extHostOutputService.ts b/src/vs/workbench/api/node/extHostOutputService.ts index 9a228497d4e..5ad2047201a 100644 --- a/src/vs/workbench/api/node/extHostOutputService.ts +++ b/src/vs/workbench/api/node/extHostOutputService.ts @@ -11,7 +11,8 @@ import { OutputAppender } from 'vs/workbench/services/output/node/outputAppender import { toLocalISOString } from 'vs/base/common/date'; import { dirExists, mkdirp } from 'vs/base/node/pfs'; import { AbstractExtHostOutputChannel, ExtHostPushOutputChannel, ExtHostOutputService, LazyOutputChannel } from 'vs/workbench/api/common/extHostOutput'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; export class ExtHostOutputChannelBackedByFile extends AbstractExtHostOutputChannel { @@ -49,9 +50,12 @@ export class ExtHostOutputService2 extends ExtHostOutputService { private _logsLocation: URI; private _namePool: number = 1; - constructor(@IExtHostContextService extHostContext: IExtHostContextService) { - super(extHostContext); - this._logsLocation = extHostContext.initData.logsLocation; + constructor( + @IExtHostRpcService extHostRpc: IExtHostRpcService, + @IExtHostInitDataService initData: IExtHostInitDataService, + ) { + super(extHostRpc); + this._logsLocation = initData.logsLocation; } createOutputChannel(name: string): vscode.OutputChannel { diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index de5c164f00d..cd5e36c82dc 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -15,7 +15,7 @@ import { win32 } from 'vs/base/node/processes'; import { MainContext, MainThreadTaskShape, ExtHostTaskShape, IMainContext } from 'vs/workbench/api/common/extHost.protocol'; import * as types from 'vs/workbench/api/common/extHostTypes'; -import { ExtHostWorkspace, IExtHostWorkspaceProvider } from 'vs/workbench/api/common/extHostWorkspace'; +import { IExtHostWorkspaceProvider, IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; import * as vscode from 'vscode'; import { TaskDefinitionDTO, TaskExecutionDTO, TaskPresentationOptionsDTO, @@ -25,8 +25,8 @@ import { TaskDTO, TaskHandleDTO, TaskFilterDTO, TaskProcessStartedDTO, TaskProcessEndedDTO, TaskSystemInfoDTO, TaskSetDTO } from '../common/shared/tasks'; import { ExtHostVariableResolverService } from 'vs/workbench/api/node/extHostDebugService'; -import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { ExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; +import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; +import { IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; @@ -354,11 +354,11 @@ interface HandlerData { export class ExtHostTask implements ExtHostTaskShape { - private _proxy: MainThreadTaskShape; - private _workspaceProvider: IExtHostWorkspaceProvider; - private _editorService: ExtHostDocumentsAndEditors; - private _configurationService: ExtHostConfiguration; - private _terminalService: IExtHostTerminalService; + private readonly _proxy: MainThreadTaskShape; + private readonly _workspaceProvider: IExtHostWorkspaceProvider; + private readonly _editorService: IExtHostDocumentsAndEditors; + private readonly _configurationService: IExtHostConfiguration; + private readonly _terminalService: IExtHostTerminalService; private _handleCounter: number; private _handlers: Map; private _taskExecutions: Map; @@ -373,10 +373,11 @@ export class ExtHostTask implements ExtHostTaskShape { constructor( mainContext: IMainContext, - workspaceService: ExtHostWorkspace, - editorService: ExtHostDocumentsAndEditors, - configurationService: ExtHostConfiguration, - extHostTerminalService: IExtHostTerminalService) { + @IExtHostWorkspace workspaceService: IExtHostWorkspace, + @IExtHostDocumentsAndEditors editorService: IExtHostDocumentsAndEditors, + @IExtHostConfiguration configurationService: IExtHostConfiguration, + @IExtHostTerminalService extHostTerminalService: IExtHostTerminalService + ) { this._proxy = mainContext.getProxy(MainContext.MainThreadTask); this._workspaceProvider = workspaceService; this._editorService = editorService; diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index d6f5694833a..f1d27d99781 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -23,8 +23,8 @@ import { ExtHostDocumentsAndEditors, IExtHostDocumentsAndEditors } from 'vs/work import { getSystemShell, detectAvailableShells } from 'vs/workbench/contrib/terminal/node/terminal'; import { getMainProcessParentEnv } from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { IExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; export class BaseExtHostTerminal { public _id: number | undefined; @@ -228,13 +228,13 @@ export class ExtHostTerminalService implements IExtHostTerminalService, ExtHostT public get onDidWriteTerminalData(): Event { return this._onDidWriteTerminalData && this._onDidWriteTerminalData.event; } constructor( - @IExtHostContextService extHostContext: IExtHostContextService, + @IExtHostRpcService extHostRpc: IExtHostRpcService, @IExtHostConfiguration private _extHostConfiguration: ExtHostConfiguration, @IExtHostWorkspace private _extHostWorkspace: ExtHostWorkspace, @IExtHostDocumentsAndEditors private _extHostDocumentsAndEditors: ExtHostDocumentsAndEditors, @ILogService private _logService: ILogService ) { - this._proxy = extHostContext.rpc.getProxy(MainContext.MainThreadTerminalService); + this._proxy = extHostRpc.getProxy(MainContext.MainThreadTerminalService); this._onDidWriteTerminalData = new Emitter({ onFirstListenerAdd: () => this._proxy.$startSendingDataEvents(), onLastListenerRemove: () => this._proxy.$stopSendingDataEvents() diff --git a/src/vs/workbench/services/extensions/node/extensionHostMain.ts b/src/vs/workbench/services/extensions/node/extensionHostMain.ts index 18b294ad091..9a35343785c 100644 --- a/src/vs/workbench/services/extensions/node/extensionHostMain.ts +++ b/src/vs/workbench/services/extensions/node/extensionHostMain.ts @@ -17,9 +17,10 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' import { ILogService } from 'vs/platform/log/common/log'; import { getSingletonServiceDescriptors } from 'vs/platform/instantiation/common/extensions'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { IExtHostContextService, ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IExtHostRpcService, ExtHostRpcService } from 'vs/workbench/api/common/rpcService'; // we don't (yet) throw when extensions parse // uris that have no scheme @@ -68,10 +69,11 @@ export class ExtensionHostMain { // bootstrap services const services = new ServiceCollection(...getSingletonServiceDescriptors()); - services.set(IExtHostContextService, new ExtHostContextService(rpcProtocol, initData)); + services.set(IExtHostInitDataService, { _serviceBrand: undefined, ...initData }); + services.set(IExtHostRpcService, new ExtHostRpcService(rpcProtocol)); services.set(ILogService, extHostLogService); - const instaService: IInstantiationService = new InstantiationService(services); + const instaService: IInstantiationService = new InstantiationService(services, true); extHostLogService.info('extension host started'); extHostLogService.trace('initData', initData); @@ -79,7 +81,8 @@ export class ExtensionHostMain { this._extensionService = instaService.createInstance( ExtHostExtensionService, hostUtils, - uriTransformer + uriTransformer, + rpcProtocol ); // error forwarding and stack trace scanning diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index ea33dffbd70..02dbd2c7852 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -21,7 +21,7 @@ import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands'; import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { MainContext, ExtHostContext, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; import * as vscode from 'vscode'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -30,8 +30,6 @@ import { NullLogService } from 'vs/platform/log/common/log'; import { ITextModel } from 'vs/editor/common/model'; import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { dispose } from 'vs/base/common/lifecycle'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; const defaultSelector = { scheme: 'far' }; const model: ITextModel = EditorModel.createFromString( @@ -95,9 +93,7 @@ suite('ExtHostLanguageFeatureCommands', function () { inst = instantiationService; } - const extHostContext = new ExtHostContextService(rpcProtocol, new class extends mock() { }); - - const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(extHostContext); + const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(rpcProtocol); extHostDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ addedDocuments: [{ isDirty: false, @@ -111,7 +107,7 @@ suite('ExtHostLanguageFeatureCommands', function () { const extHostDocuments = new ExtHostDocuments(rpcProtocol, extHostDocumentsAndEditors); rpcProtocol.set(ExtHostContext.ExtHostDocuments, extHostDocuments); - commands = new ExtHostCommands(extHostContext, new NullLogService()); + commands = new ExtHostCommands(rpcProtocol, new NullLogService()); rpcProtocol.set(ExtHostContext.ExtHostCommands, commands); rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol)); ExtHostApiCommands.register(commands); @@ -185,7 +181,7 @@ suite('ExtHostLanguageFeatureCommands', function () { test('executeWorkspaceSymbolProvider should accept empty string, #39522', async function () { disposables.push(extHost.registerWorkspaceSymbolProvider(nullExtensionDescription, { - provideWorkspaceSymbols(query): vscode.SymbolInformation[] { + provideWorkspaceSymbols(): vscode.SymbolInformation[] { return [new types.SymbolInformation('hello', types.SymbolKind.Array, new types.Range(0, 0, 0, 0), URI.parse('foo:bar')) as vscode.SymbolInformation]; } })); @@ -316,7 +312,7 @@ suite('ExtHostLanguageFeatureCommands', function () { test('reference search, back and forth', function () { disposables.push(extHost.registerReferenceProvider(nullExtensionDescription, defaultSelector, { - provideReferences(doc: any) { + provideReferences() { return [ new types.Location(URI.parse('some:uri/path'), new types.Range(0, 1, 0, 5)) ]; @@ -392,7 +388,7 @@ suite('ExtHostLanguageFeatureCommands', function () { test('Suggest, back and forth', function () { disposables.push(extHost.registerCompletionItemProvider(nullExtensionDescription, defaultSelector, { - provideCompletionItems(doc, pos): any { + provideCompletionItems(): any { let a = new types.CompletionItem('item1'); let b = new types.CompletionItem('item2'); b.textEdit = types.TextEdit.replace(new types.Range(0, 4, 0, 8), 'foo'); // overwite after @@ -728,7 +724,7 @@ suite('ExtHostLanguageFeatureCommands', function () { provideDocumentColors(): vscode.ColorInformation[] { return [new types.ColorInformation(new types.Range(0, 0, 0, 20), new types.Color(0.1, 0.2, 0.3, 0.4))]; }, - provideColorPresentations(color: vscode.Color, context: { range: vscode.Range, document: vscode.TextDocument }): vscode.ColorPresentation[] { + provideColorPresentations(): vscode.ColorPresentation[] { const cp = new types.ColorPresentation('#ABC'); cp.textEdit = types.TextEdit.replace(new types.Range(1, 0, 1, 20), '#ABC'); cp.additionalTextEdits = [types.TextEdit.insert(new types.Position(2, 20), '*')]; diff --git a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts index 0f4769ae329..cbf97988142 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts @@ -5,12 +5,11 @@ import * as assert from 'assert'; import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadCommandsShape, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainThreadCommandsShape } from 'vs/workbench/api/common/extHost.protocol'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { SingleProxyRPCProtocol } from './testRPCProtocol'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { NullLogService } from 'vs/platform/log/common/log'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; suite('ExtHostCommands', function () { @@ -28,7 +27,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands( - new ExtHostContextService(SingleProxyRPCProtocol(shape), new class extends mock() { }), + SingleProxyRPCProtocol(shape), new NullLogService() ); commands.registerCommand(true, 'foo', (): any => { }).dispose(); @@ -51,7 +50,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands( - new ExtHostContextService(SingleProxyRPCProtocol(shape), new class extends mock() { }), + SingleProxyRPCProtocol(shape), new NullLogService() ); const reg = commands.registerCommand(true, 'foo', (): any => { }); diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts index 4e2f172115a..c2bfcdd6605 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { URI, UriComponents } from 'vs/base/common/uri'; import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; import { ExtHostConfigProvider } from 'vs/workbench/api/common/extHostConfiguration'; -import { MainThreadConfigurationShape, IConfigurationInitData, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainThreadConfigurationShape, IConfigurationInitData } from 'vs/workbench/api/common/extHost.protocol'; import { ConfigurationModel } from 'vs/platform/configuration/common/configurationModels'; import { TestRPCProtocol } from './testRPCProtocol'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; @@ -15,6 +15,7 @@ import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/ import { ConfigurationTarget, IConfigurationModel } from 'vs/platform/configuration/common/configuration'; import { NullLogService } from 'vs/platform/log/common/log'; import { assign } from 'vs/base/common/objects'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; suite('ExtHostConfiguration', function () { @@ -27,11 +28,7 @@ suite('ExtHostConfiguration', function () { } function createExtHostWorkspace(): ExtHostWorkspace { - return new ExtHostWorkspace({ - _serviceBrand: undefined, - rpc: new TestRPCProtocol(), - initData: new class extends mock() { } - }, new NullLogService()); + return new ExtHostWorkspace(new TestRPCProtocol(), new class extends mock() { }, new NullLogService()); } function createExtHostConfiguration(contents: any = Object.create(null), shape?: MainThreadConfigurationShape) { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts index bf67278fb60..d85eae55ebf 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDocumentSaveParticipant.test.ts @@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri'; import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { TextDocumentSaveReason, TextEdit, Position, EndOfLine } from 'vs/workbench/api/common/extHostTypes'; -import { MainThreadTextEditorsShape, IWorkspaceEditDto, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainThreadTextEditorsShape, IWorkspaceEditDto } from 'vs/workbench/api/common/extHost.protocol'; import { ExtHostDocumentSaveParticipant } from 'vs/workbench/api/common/extHostDocumentSaveParticipant'; import { SingleProxyRPCProtocol } from './testRPCProtocol'; import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; @@ -17,7 +17,6 @@ import { NullLogService } from 'vs/platform/log/common/log'; import { isResourceTextEdit, ResourceTextEdit } from 'vs/editor/common/modes'; import { timeout } from 'vs/base/common/async'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; suite('ExtHostDocumentSaveParticipant', () => { @@ -38,8 +37,7 @@ suite('ExtHostDocumentSaveParticipant', () => { }; setup(() => { - const extHostContext = new ExtHostContextService(SingleProxyRPCProtocol(null), new class extends mock() { }); - const documentsAndEditors = new ExtHostDocumentsAndEditors(extHostContext); + const documentsAndEditors = new ExtHostDocumentsAndEditors(SingleProxyRPCProtocol(null)); documentsAndEditors.$acceptDocumentsAndEditorsDelta({ addedDocuments: [{ isDirty: false, diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts index 8eb015f77dc..ce9209f9344 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts @@ -6,24 +6,14 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; -import { mock } from 'vs/workbench/test/electron-browser/api/mock'; -import { IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; suite('ExtHostDocumentsAndEditors', () => { let editors: ExtHostDocumentsAndEditors; setup(function () { - - editors = new ExtHostDocumentsAndEditors({ - _serviceBrand: undefined, - rpc: { - getProxy: () => { return undefined!; }, - set: undefined!, - assertRegistered: undefined! - }, - initData: new class extends mock() { } - }); + editors = new ExtHostDocumentsAndEditors(new TestRPCProtocol()); }); test('The value of TextDocument.isClosed is incorrect when a text document is closed, #27949', () => { diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index b31cebfb56d..18ecedc673b 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -34,7 +34,7 @@ import { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/provideSi import { provideSuggestionItems, CompletionOptions } from 'vs/editor/contrib/suggest/suggest'; import { getDocumentFormattingEditsUntilResult, getDocumentRangeFormattingEditsUntilResult, getOnTypeFormattingEdits } from 'vs/editor/contrib/format/format'; import { getLinks } from 'vs/editor/contrib/links/getLinks'; -import { MainContext, ExtHostContext, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; import * as vscode from 'vscode'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -48,7 +48,6 @@ import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { dispose } from 'vs/base/common/lifecycle'; import { withNullAsUndefined } from 'vs/base/common/types'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; const defaultSelector = { scheme: 'far' }; const model: ITextModel = EditorModel.createFromString( @@ -86,9 +85,7 @@ suite('ExtHostLanguageFeatures', function () { originalErrorHandler = errorHandler.getUnexpectedErrorHandler(); setUnexpectedErrorHandler(() => { }); - const extHostContext = new ExtHostContextService(rpcProtocol, new class extends mock() { }); - - const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(extHostContext); + const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(rpcProtocol); extHostDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ addedDocuments: [{ isDirty: false, @@ -102,7 +99,7 @@ suite('ExtHostLanguageFeatures', function () { const extHostDocuments = new ExtHostDocuments(rpcProtocol, extHostDocumentsAndEditors); rpcProtocol.set(ExtHostContext.ExtHostDocuments, extHostDocuments); - const commands = new ExtHostCommands(extHostContext, new NullLogService()); + const commands = new ExtHostCommands(rpcProtocol, new NullLogService()); rpcProtocol.set(ExtHostContext.ExtHostCommands, commands); rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol)); diff --git a/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts index 3690ff5519f..a66b5b43b9f 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTextEditors.test.ts @@ -4,14 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; -import { MainContext, MainThreadTextEditorsShape, IWorkspaceEditDto, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainContext, MainThreadTextEditorsShape, IWorkspaceEditDto } from 'vs/workbench/api/common/extHost.protocol'; import { URI } from 'vs/base/common/uri'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { SingleProxyRPCProtocol, TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors'; import { ResourceTextEdit } from 'vs/editor/common/modes'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; suite('ExtHostTextEditors.applyWorkspaceEdit', () => { @@ -29,8 +28,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => { return Promise.resolve(true); } }); - const extHostContext = new ExtHostContextService(SingleProxyRPCProtocol(null), new class extends mock() { }); - const documentsAndEditors = new ExtHostDocumentsAndEditors(extHostContext); + const documentsAndEditors = new ExtHostDocumentsAndEditors(SingleProxyRPCProtocol(null)); documentsAndEditors.$acceptDocumentsAndEditorsDelta({ addedDocuments: [{ isDirty: false, diff --git a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts index f0e702295d8..bc50a3dd00a 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts @@ -8,7 +8,7 @@ import * as sinon from 'sinon'; import { Emitter } from 'vs/base/common/event'; import { ExtHostTreeViews } from 'vs/workbench/api/common/extHostTreeViews'; import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; -import { MainThreadTreeViewsShape, MainContext, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { MainThreadTreeViewsShape, MainContext } from 'vs/workbench/api/common/extHost.protocol'; import { TreeDataProvider, TreeItem } from 'vscode'; import { TestRPCProtocol } from './testRPCProtocol'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; @@ -18,7 +18,6 @@ import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { TreeItemCollapsibleState, ITreeItem } from 'vs/workbench/common/views'; import { NullLogService } from 'vs/platform/log/common/log'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostContextService } from 'vs/workbench/api/common/extHostContextService'; suite('ExtHostTreeView', function () { @@ -73,7 +72,7 @@ suite('ExtHostTreeView', function () { rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol)); target = new RecordingShape(); testObject = new ExtHostTreeViews(target, new ExtHostCommands( - new ExtHostContextService(rpcProtocol, new class extends mock() { }), + rpcProtocol, new NullLogService() ), new NullLogService()); onDidChangeTreeNode = new Emitter<{ key: string }>(); diff --git a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts b/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts index 833b6dbc7a9..285ac356774 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts @@ -11,18 +11,20 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { IWorkspaceFolderData } from 'vs/platform/workspace/common/workspace'; import { MainThreadWorkspace } from 'vs/workbench/api/browser/mainThreadWorkspace'; -import { IMainContext, IWorkspaceData, MainContext, IInitData } from 'vs/workbench/api/common/extHost.protocol'; +import { IMainContext, IWorkspaceData, MainContext } from 'vs/workbench/api/common/extHost.protocol'; import { RelativePattern } from 'vs/workbench/api/common/extHostTypes'; import { ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import { TestRPCProtocol } from './testRPCProtocol'; +import { ExtHostRpcService } from 'vs/workbench/api/common/rpcService'; +import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; function createExtHostWorkspace(mainContext: IMainContext, data: IWorkspaceData, logService: ILogService): ExtHostWorkspace { - const result = new ExtHostWorkspace({ - _serviceBrand: undefined, - rpc: mainContext, - initData: new class extends mock() { workspace = data; } - }, logService); + const result = new ExtHostWorkspace( + new ExtHostRpcService(mainContext), + new class extends mock() { workspace = data; }, + logService + ); result.$initializeWorkspace(data); return result; } diff --git a/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts b/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts index 64fa203834f..a51c4feb788 100644 --- a/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts +++ b/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts @@ -7,9 +7,11 @@ import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyId import { CharCode } from 'vs/base/common/charCode'; import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; import { isThenable } from 'vs/base/common/async'; +import { IExtHostRpcService } from 'vs/workbench/api/common/rpcService'; -export function SingleProxyRPCProtocol(thing: any): IExtHostContext { +export function SingleProxyRPCProtocol(thing: any): IExtHostContext & IExtHostRpcService { return { + _serviceBrand: undefined, remoteAuthority: null!, getProxy(): T { return thing; @@ -21,8 +23,9 @@ export function SingleProxyRPCProtocol(thing: any): IExtHostContext { }; } -export class TestRPCProtocol implements IExtHostContext { +export class TestRPCProtocol implements IExtHostContext, IExtHostRpcService { + public _serviceBrand = undefined; public remoteAuthority = null!; private _callCountValue: number = 0; -- GitLab