From 3c267cd4e04dcfbdf9c0c154d19ee6d01ffed463 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 12 Jun 2020 11:19:48 -0700 Subject: [PATCH 1/6] autoStartBasicFix --- .vscode/launch.json | 5 +++-- .../datascience/interactive-common/interactiveBase.ts | 4 +++- .../datascience/interactive-common/notebookProvider.ts | 9 +++++++-- .../interactive-common/notebookServerProvider.ts | 9 ++++++++- src/client/datascience/raw-kernel/rawNotebookProvider.ts | 5 +++++ src/client/datascience/types.ts | 8 ++++++++ .../datascience/uiTests/ipywidget.ui.functional.test.ts | 6 ++++-- 7 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c3c2fc2cb005..b771199c6684 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -307,17 +307,18 @@ "--recursive", "--colors", //"--grep", "", + "--grep", "IANHU", "--timeout=300000" ], "env": { // Remove `X` prefix to test with real browser to host DS ui (for DS functional tests). "XVSC_PYTHON_DS_UI_BROWSER": "1", // Remove `X` prefix to test with real python (for DS functional tests). - "XVSCODE_PYTHON_ROLLING": "1", + "VSCODE_PYTHON_ROLLING": "1", // Remove 'X' to turn on all logging in the debug output "XVSC_PYTHON_FORCE_LOGGING": "1", // Remove `X` prefix and update path to test with real python interpreter (for DS functional tests). - "XCI_PYTHON_PATH": "", + "CI_PYTHON_PATH": "/Users/ianhuff/opt/miniconda3/envs/functionalTestEnv/bin/python", // Remove 'X' prefix to dump output for debugger. Directory has to exist prior to launch "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output" }, diff --git a/src/client/datascience/interactive-common/interactiveBase.ts b/src/client/datascience/interactive-common/interactiveBase.ts index 6e1b2323f29e..25a3913a7695 100644 --- a/src/client/datascience/interactive-common/interactiveBase.ts +++ b/src/client/datascience/interactive-common/interactiveBase.ts @@ -200,7 +200,9 @@ export abstract class InteractiveBase extends WebViewHost>(); private _notebookCreated = new EventEmitter<{ identity: Uri; notebook: INotebook }>(); + private _connectionMade = new EventEmitter(); private _type: 'jupyter' | 'raw' = 'jupyter'; public get activeNotebooks() { return [...this.notebooks.values()]; @@ -56,6 +57,10 @@ export class NotebookProvider implements INotebookProvider { return this._notebookCreated.event; } + public get onConnectionMade() { + return this._connectionMade.event; + } + public get type(): 'jupyter' | 'raw' { return this._type; } @@ -72,9 +77,9 @@ export class NotebookProvider implements INotebookProvider { public async connect(options: ConnectNotebookProviderOptions): Promise { // Connect to either a jupyter server or a stubbed out raw notebook "connection" if (await this.rawNotebookProvider.supported()) { - return this.rawNotebookProvider.connect(options); + return this.rawNotebookProvider.connect({ ...options, onConnectionMadeEvent: this._connectionMade }); } else { - return this.jupyterNotebookProvider.connect(options); + return this.jupyterNotebookProvider.connect({ ...options, onConnectionMadeEvent: this._connectionMade }); } } diff --git a/src/client/datascience/interactive-common/notebookServerProvider.ts b/src/client/datascience/interactive-common/notebookServerProvider.ts index 0d697ff6dd1d..527c077df1c4 100644 --- a/src/client/datascience/interactive-common/notebookServerProvider.ts +++ b/src/client/datascience/interactive-common/notebookServerProvider.ts @@ -53,7 +53,14 @@ export class NotebookServerProvider implements IJupyterServerProvider { return this.jupyterExecution.getServer(serverOptions); } else { // Otherwise create a new server - return this.createServer(options, token); + return this.createServer(options, token).then((val) => { + // If we created a new server notify of our first time provider connection + if (options.onConnectionMadeEvent) { + options.onConnectionMadeEvent.fire(); + } + + return val; + }); } } diff --git a/src/client/datascience/raw-kernel/rawNotebookProvider.ts b/src/client/datascience/raw-kernel/rawNotebookProvider.ts index 8d4e39e34b93..78e1f53539e0 100644 --- a/src/client/datascience/raw-kernel/rawNotebookProvider.ts +++ b/src/client/datascience/raw-kernel/rawNotebookProvider.ts @@ -63,6 +63,11 @@ export class RawNotebookProviderBase implements IRawNotebookProvider { // If not get only, create if needed and return if (!this.rawConnection) { this.rawConnection = new RawConnection(); + + // Fire our optional event that we have created a connection + if (options.onConnectionMadeEvent) { + options.onConnectionMadeEvent.fire(); + } } return Promise.resolve(this.rawConnection); } diff --git a/src/client/datascience/types.ts b/src/client/datascience/types.ts index b3b3cba94fbd..1fefce7da55e 100644 --- a/src/client/datascience/types.ts +++ b/src/client/datascience/types.ts @@ -21,6 +21,7 @@ import { Uri, WebviewPanel } from 'vscode'; +import { EventEmitter } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; import type { Data as WebSocketData } from 'ws'; import { ServerStatus } from '../../datascience-ui/interactive-common/mainState'; @@ -243,6 +244,7 @@ export type ConnectNotebookProviderOptions = { disableUI?: boolean; localOnly?: boolean; token?: CancellationToken; + onConnectionMadeEvent?: EventEmitter; // Optional event to signal when a connection is first made to this provider }; export interface INotebookServerOptions { @@ -1052,6 +1054,7 @@ export type GetServerOptions = { disableUI?: boolean; localOnly?: boolean; token?: CancellationToken; + onConnectionMadeEvent?: EventEmitter; // Optional event to signal when a connection is first made to this provider }; /** @@ -1073,6 +1076,11 @@ export interface INotebookProvider { */ onNotebookCreated: Event<{ identity: Uri; notebook: INotebook }>; + /** + * Fired just the first time that this provider connects + */ + onConnectionMade: Event; + /** * List of all notebooks (active and ones that are being constructed). */ diff --git a/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts b/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts index cb3c417d9ae4..73c5788e0444 100644 --- a/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts +++ b/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts @@ -29,7 +29,9 @@ const retryIfFail = (fn: () => Promise) => retryIfFailOriginal(fn, wait use(chaiAsPromised); -[false, true].forEach((useRawKernel) => { +//[false, true].forEach((useRawKernel) => { +//[true].forEach((useRawKernel) => { +[true].forEach((useRawKernel) => { //import { asyncDump } from '../common/asyncDump'; suite(`DataScience IPyWidgets (${useRawKernel ? 'With Direct Kernel' : 'With Jupyter Server'})`, () => { const disposables: Disposable[] = []; @@ -145,7 +147,7 @@ use(chaiAsPromised); assert.equal(count, 3); }); }); - test('Output displayed after executing a cell', async () => { + test('IANHU Output displayed after executing a cell', async () => { const { notebookUI } = await openABCIpynb(); await assert.eventually.isFalse(notebookUI.cellHasOutput(0)); From 57ce443f12ca9648130dd77c3cbe5fc3e70bdd7d Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 12 Jun 2020 14:59:13 -0700 Subject: [PATCH 2/6] jupyter execution removed --- .vscode/launch.json | 2 +- .../interactive-common/interactiveBase.ts | 44 +------------------ .../interactive-ipynb/nativeEditor.ts | 3 -- .../nativeEditorOldWebView.ts | 3 -- .../interactive-window/interactiveWindow.ts | 3 -- .../datascience/jupyter/jupyterExecution.ts | 5 --- src/client/datascience/types.ts | 3 +- .../nativeEditorProvider.functional.test.ts | 3 -- .../nativeEditorStorage.unit.test.ts | 3 -- .../datascience/liveshare.functional.test.tsx | 2 +- 10 files changed, 4 insertions(+), 67 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b771199c6684..12a8467505a8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -307,7 +307,7 @@ "--recursive", "--colors", //"--grep", "", - "--grep", "IANHU", + //"--grep", "IANHU", "--timeout=300000" ], "env": { diff --git a/src/client/datascience/interactive-common/interactiveBase.ts b/src/client/datascience/interactive-common/interactiveBase.ts index 25a3913a7695..18d1a6bb7849 100644 --- a/src/client/datascience/interactive-common/interactiveBase.ts +++ b/src/client/datascience/interactive-common/interactiveBase.ts @@ -80,7 +80,6 @@ import { IInteractiveWindowInfo, IInteractiveWindowListener, IJupyterDebugger, - IJupyterExecution, IJupyterKernelSpec, IJupyterVariableDataProviderFactory, IJupyterVariables, @@ -134,7 +133,6 @@ export abstract class InteractiveBase extends WebViewHost this.activating()); this.disposables.push(handler); - // If our execution changes its liveshare session, we need to close our server - this.jupyterExecution.sessionChanged(() => this.reloadAfterShutdown()); - // For each listener sign up for their post events this.listeners.forEach((l) => l.postMessage((e) => this.postMessageInternal(e.message, e.payload))); // Channel for listeners to send messages to the interactive base. @@ -199,9 +194,7 @@ export abstract class InteractiveBase extends WebViewHost { - // Finish either of our notebook promises - if (this.connectionAndNotebookPromise) { - await this.connectionAndNotebookPromise; - this.connectionAndNotebookPromise = undefined; - } - if (this.notebookPromise) { - await this.notebookPromise; - this.notebookPromise = undefined; - } - // If we have a notebook dispose of it - if (this._notebook) { - const notebook = this._notebook; - this._notebook = undefined; - await notebook.dispose(); - } - - // Disconnect from our notebook provider - await this.notebookProvider.disconnect({ getOnly: true }); - } - // ensureNotebook can be called apart from ensureNotebookAndServer and it needs // the same protection to not be called twice // tslint:disable-next-line: member-ordering @@ -1207,20 +1179,6 @@ export abstract class InteractiveBase extends WebViewHost { - try { - await this.stopServer(); - } catch { - // We just switched from host to guest mode. Don't really care - // if closing the host server kills it. - this._notebook = undefined; - } finally { - this.connectionAndNotebookPromise = undefined; - this.notebookPromise = undefined; - } - await this.ensureConnectionAndNotebook(); - } - @captureTelemetry(Telemetry.GotoSourceCode, undefined, false) private gotoCode(args: IGotoCode) { this.gotoCodeInternal(args.file, args.line).catch((err) => { diff --git a/src/client/datascience/interactive-ipynb/nativeEditor.ts b/src/client/datascience/interactive-ipynb/nativeEditor.ts index b436b2307ed2..dd3d3aa023fe 100644 --- a/src/client/datascience/interactive-ipynb/nativeEditor.ts +++ b/src/client/datascience/interactive-ipynb/nativeEditor.ts @@ -66,7 +66,6 @@ import { IInteractiveWindowInfo, IInteractiveWindowListener, IJupyterDebugger, - IJupyterExecution, IJupyterKernelSpec, IJupyterVariableDataProviderFactory, IJupyterVariables, @@ -160,7 +159,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor { @inject(ICodeCssGenerator) cssGenerator: ICodeCssGenerator, @inject(IThemeFinder) themeFinder: IThemeFinder, @inject(IStatusProvider) statusProvider: IStatusProvider, - @inject(IJupyterExecution) jupyterExecution: IJupyterExecution, @inject(IFileSystem) fileSystem: IFileSystem, @inject(IConfigurationService) configuration: IConfigurationService, @inject(ICommandManager) commandManager: ICommandManager, @@ -193,7 +191,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor { cssGenerator, themeFinder, statusProvider, - jupyterExecution, fileSystem, configuration, jupyterExporter, diff --git a/src/client/datascience/interactive-ipynb/nativeEditorOldWebView.ts b/src/client/datascience/interactive-ipynb/nativeEditorOldWebView.ts index 58def5a92b0a..5db34dad06d2 100644 --- a/src/client/datascience/interactive-ipynb/nativeEditorOldWebView.ts +++ b/src/client/datascience/interactive-ipynb/nativeEditorOldWebView.ts @@ -39,7 +39,6 @@ import { IDataScienceErrorHandler, IInteractiveWindowListener, IJupyterDebugger, - IJupyterExecution, IJupyterVariableDataProviderFactory, IJupyterVariables, INotebookEditorProvider, @@ -81,7 +80,6 @@ export class NativeEditorOldWebView extends NativeEditor { @inject(ICodeCssGenerator) cssGenerator: ICodeCssGenerator, @inject(IThemeFinder) themeFinder: IThemeFinder, @inject(IStatusProvider) statusProvider: IStatusProvider, - @inject(IJupyterExecution) jupyterExecution: IJupyterExecution, @inject(IFileSystem) fileSystem: IFileSystem, @inject(IConfigurationService) configuration: IConfigurationService, @inject(ICommandManager) commandManager: ICommandManager, @@ -115,7 +113,6 @@ export class NativeEditorOldWebView extends NativeEditor { cssGenerator, themeFinder, statusProvider, - jupyterExecution, fileSystem, configuration, commandManager, diff --git a/src/client/datascience/interactive-window/interactiveWindow.ts b/src/client/datascience/interactive-window/interactiveWindow.ts index 005e38138021..4a9d70308f68 100644 --- a/src/client/datascience/interactive-window/interactiveWindow.ts +++ b/src/client/datascience/interactive-window/interactiveWindow.ts @@ -52,7 +52,6 @@ import { IInteractiveWindowListener, IInteractiveWindowProvider, IJupyterDebugger, - IJupyterExecution, IJupyterKernelSpec, IJupyterVariableDataProviderFactory, IJupyterVariables, @@ -96,7 +95,6 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi @inject(IDisposableRegistry) disposables: IDisposableRegistry, @inject(ICodeCssGenerator) cssGenerator: ICodeCssGenerator, @inject(IThemeFinder) themeFinder: IThemeFinder, - @inject(IJupyterExecution) jupyterExecution: IJupyterExecution, @inject(IFileSystem) fileSystem: IFileSystem, @inject(IConfigurationService) configuration: IConfigurationService, @inject(ICommandManager) commandManager: ICommandManager, @@ -127,7 +125,6 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi cssGenerator, themeFinder, statusProvider, - jupyterExecution, fileSystem, configuration, jupyterExporter, diff --git a/src/client/datascience/jupyter/jupyterExecution.ts b/src/client/datascience/jupyter/jupyterExecution.ts index 2e4914a13e12..65fcf9b9f04d 100644 --- a/src/client/datascience/jupyter/jupyterExecution.ts +++ b/src/client/datascience/jupyter/jupyterExecution.ts @@ -37,7 +37,6 @@ const LocalHosts = ['localhost', '127.0.0.1', '::1']; export class JupyterExecutionBase implements IJupyterExecution { private usablePythonInterpreter: PythonInterpreter | undefined; - private eventEmitter: EventEmitter = new EventEmitter(); private startedEmitter: EventEmitter = new EventEmitter(); private disposed: boolean = false; private readonly jupyterInterpreterService: IJupyterSubCommandExecutionService; @@ -71,10 +70,6 @@ export class JupyterExecutionBase implements IJupyterExecution { } } - public get sessionChanged(): Event { - return this.eventEmitter.event; - } - public get serverStarted(): Event { return this.startedEmitter.event; } diff --git a/src/client/datascience/types.ts b/src/client/datascience/types.ts index 1fefce7da55e..ea1b86472b8f 100644 --- a/src/client/datascience/types.ts +++ b/src/client/datascience/types.ts @@ -14,6 +14,7 @@ import { DebugSession, Disposable, Event, + EventEmitter, LanguageConfiguration, Range, TextDocument, @@ -21,7 +22,6 @@ import { Uri, WebviewPanel } from 'vscode'; -import { EventEmitter } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; import type { Data as WebSocketData } from 'ws'; import { ServerStatus } from '../../datascience-ui/interactive-common/mainState'; @@ -282,7 +282,6 @@ export interface IGatherLogger extends INotebookExecutionLogger { export const IJupyterExecution = Symbol('IJupyterExecution'); export interface IJupyterExecution extends IAsyncDisposable { - sessionChanged: Event; serverStarted: Event; isNotebookSupported(cancelToken?: CancellationToken): Promise; isImportSupported(cancelToken?: CancellationToken): Promise; diff --git a/src/test/datascience/interactive-ipynb/nativeEditorProvider.functional.test.ts b/src/test/datascience/interactive-ipynb/nativeEditorProvider.functional.test.ts index dda03edf2c3c..4d2688a8b153 100644 --- a/src/test/datascience/interactive-ipynb/nativeEditorProvider.functional.test.ts +++ b/src/test/datascience/interactive-ipynb/nativeEditorProvider.functional.test.ts @@ -118,9 +118,6 @@ suite('DataScience - Native Editor Provider', () => { const editorChangeEvent = new EventEmitter(); when(docManager.onDidChangeActiveTextEditor).thenReturn(editorChangeEvent.event); - const sessionChangedEvent = new EventEmitter(); - when(executionProvider.sessionChanged).thenReturn(sessionChangedEvent.event); - const serverStartedEvent = new EventEmitter(); when(executionProvider.serverStarted).thenReturn(serverStartedEvent.event); diff --git a/src/test/datascience/interactive-ipynb/nativeEditorStorage.unit.test.ts b/src/test/datascience/interactive-ipynb/nativeEditorStorage.unit.test.ts index 5c672f1b42d7..7dd3bf696432 100644 --- a/src/test/datascience/interactive-ipynb/nativeEditorStorage.unit.test.ts +++ b/src/test/datascience/interactive-ipynb/nativeEditorStorage.unit.test.ts @@ -269,9 +269,6 @@ suite('DataScience - Native Editor Storage', () => { const editorChangeEvent = new EventEmitter(); when(docManager.onDidChangeActiveTextEditor).thenReturn(editorChangeEvent.event); - const sessionChangedEvent = new EventEmitter(); - when(executionProvider.sessionChanged).thenReturn(sessionChangedEvent.event); - const serverStartedEvent = new EventEmitter(); when(executionProvider.serverStarted).thenReturn(serverStartedEvent.event); diff --git a/src/test/datascience/liveshare.functional.test.tsx b/src/test/datascience/liveshare.functional.test.tsx index 2f1a6817be12..8369d449e4b6 100644 --- a/src/test/datascience/liveshare.functional.test.tsx +++ b/src/test/datascience/liveshare.functional.test.tsx @@ -33,7 +33,7 @@ import { addMockData, CellPosition, mountConnectedMainPanel, verifyHtmlOnCell, w //tslint:disable:trailing-comma no-any no-multiline-string // tslint:disable-next-line:max-func-body-length no-any -suite('DataScience LiveShare tests', () => { +suite('IANHU DataScience LiveShare tests', () => { const disposables: Disposable[] = []; let hostContainer: DataScienceIocContainer; let guestContainer: DataScienceIocContainer; From 328f56307f8ccdb00f36a255a1470aca87eab6f8 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 12 Jun 2020 15:32:20 -0700 Subject: [PATCH 3/6] prereview cleanup --- .vscode/launch.json | 5 ++--- .../interactive-common/interactiveBase.ts | 2 +- .../interactive-common/notebookServerProvider.ts | 2 +- src/test/datascience/liveshare.functional.test.tsx | 2 +- .../uiTests/ipywidget.ui.functional.test.ts | 12 +++++------- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 12a8467505a8..c3c2fc2cb005 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -307,18 +307,17 @@ "--recursive", "--colors", //"--grep", "", - //"--grep", "IANHU", "--timeout=300000" ], "env": { // Remove `X` prefix to test with real browser to host DS ui (for DS functional tests). "XVSC_PYTHON_DS_UI_BROWSER": "1", // Remove `X` prefix to test with real python (for DS functional tests). - "VSCODE_PYTHON_ROLLING": "1", + "XVSCODE_PYTHON_ROLLING": "1", // Remove 'X' to turn on all logging in the debug output "XVSC_PYTHON_FORCE_LOGGING": "1", // Remove `X` prefix and update path to test with real python interpreter (for DS functional tests). - "CI_PYTHON_PATH": "/Users/ianhuff/opt/miniconda3/envs/functionalTestEnv/bin/python", + "XCI_PYTHON_PATH": "", // Remove 'X' prefix to dump output for debugger. Directory has to exist prior to launch "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output" }, diff --git a/src/client/datascience/interactive-common/interactiveBase.ts b/src/client/datascience/interactive-common/interactiveBase.ts index 18d1a6bb7849..6f81dddaccc5 100644 --- a/src/client/datascience/interactive-common/interactiveBase.ts +++ b/src/client/datascience/interactive-common/interactiveBase.ts @@ -194,7 +194,7 @@ export abstract class InteractiveBase extends WebViewHost { // If we created a new server notify of our first time provider connection - if (options.onConnectionMadeEvent) { + if (val && options.onConnectionMadeEvent) { options.onConnectionMadeEvent.fire(); } diff --git a/src/test/datascience/liveshare.functional.test.tsx b/src/test/datascience/liveshare.functional.test.tsx index 8369d449e4b6..2f1a6817be12 100644 --- a/src/test/datascience/liveshare.functional.test.tsx +++ b/src/test/datascience/liveshare.functional.test.tsx @@ -33,7 +33,7 @@ import { addMockData, CellPosition, mountConnectedMainPanel, verifyHtmlOnCell, w //tslint:disable:trailing-comma no-any no-multiline-string // tslint:disable-next-line:max-func-body-length no-any -suite('IANHU DataScience LiveShare tests', () => { +suite('DataScience LiveShare tests', () => { const disposables: Disposable[] = []; let hostContainer: DataScienceIocContainer; let guestContainer: DataScienceIocContainer; diff --git a/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts b/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts index 73c5788e0444..5c5a914f473c 100644 --- a/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts +++ b/src/test/datascience/uiTests/ipywidget.ui.functional.test.ts @@ -29,9 +29,7 @@ const retryIfFail = (fn: () => Promise) => retryIfFailOriginal(fn, wait use(chaiAsPromised); -//[false, true].forEach((useRawKernel) => { -//[true].forEach((useRawKernel) => { -[true].forEach((useRawKernel) => { +[false, true].forEach((useRawKernel) => { //import { asyncDump } from '../common/asyncDump'; suite(`DataScience IPyWidgets (${useRawKernel ? 'With Direct Kernel' : 'With Jupyter Server'})`, () => { const disposables: Disposable[] = []; @@ -203,7 +201,7 @@ use(chaiAsPromised); assert.include(outputHtml, ') { this.notebooks.set(identity.fsPath, promise); diff --git a/src/client/datascience/interactive-common/notebookServerProvider.ts b/src/client/datascience/interactive-common/notebookServerProvider.ts index 81cbec4334a9..c2f50a9ae286 100644 --- a/src/client/datascience/interactive-common/notebookServerProvider.ts +++ b/src/client/datascience/interactive-common/notebookServerProvider.ts @@ -55,8 +55,8 @@ export class NotebookServerProvider implements IJupyterServerProvider { // Otherwise create a new server return this.createServer(options, token).then((val) => { // If we created a new server notify of our first time provider connection - if (val && options.onConnectionMadeEvent) { - options.onConnectionMadeEvent.fire(); + if (val && options.onConnectionMade) { + options.onConnectionMade(); } return val; diff --git a/src/client/datascience/raw-kernel/rawNotebookProvider.ts b/src/client/datascience/raw-kernel/rawNotebookProvider.ts index 78e1f53539e0..dffef32cdbea 100644 --- a/src/client/datascience/raw-kernel/rawNotebookProvider.ts +++ b/src/client/datascience/raw-kernel/rawNotebookProvider.ts @@ -65,8 +65,8 @@ export class RawNotebookProviderBase implements IRawNotebookProvider { this.rawConnection = new RawConnection(); // Fire our optional event that we have created a connection - if (options.onConnectionMadeEvent) { - options.onConnectionMadeEvent.fire(); + if (options.onConnectionMade) { + options.onConnectionMade(); } } return Promise.resolve(this.rawConnection); diff --git a/src/client/datascience/types.ts b/src/client/datascience/types.ts index ea1b86472b8f..f64d06f7ee2a 100644 --- a/src/client/datascience/types.ts +++ b/src/client/datascience/types.ts @@ -14,7 +14,6 @@ import { DebugSession, Disposable, Event, - EventEmitter, LanguageConfiguration, Range, TextDocument, @@ -244,7 +243,7 @@ export type ConnectNotebookProviderOptions = { disableUI?: boolean; localOnly?: boolean; token?: CancellationToken; - onConnectionMadeEvent?: EventEmitter; // Optional event to signal when a connection is first made to this provider + onConnectionMade?(): void; // Optional callback for when the first connection is made }; export interface INotebookServerOptions { @@ -1053,7 +1052,7 @@ export type GetServerOptions = { disableUI?: boolean; localOnly?: boolean; token?: CancellationToken; - onConnectionMadeEvent?: EventEmitter; // Optional event to signal when a connection is first made to this provider + onConnectionMade?(): void; // Optional callback for when the first connection is made }; /**