From 0b5feb1482ecd1fb424941ffeaa4ccc0c6381b09 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 14 Sep 2020 11:04:30 -0700 Subject: [PATCH] Oops --- .../datascience/api/jupyterIntegration.ts | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/client/datascience/api/jupyterIntegration.ts b/src/client/datascience/api/jupyterIntegration.ts index 11e4365fcdca3..4df5a8a7cd11c 100644 --- a/src/client/datascience/api/jupyterIntegration.ts +++ b/src/client/datascience/api/jupyterIntegration.ts @@ -74,29 +74,30 @@ export class JupyterExtensionIntegration { return; } await jupyterExtension.activate(); - if (jupyterExtension.isActive) { - const jupyterExtensionApi = jupyterExtension.exports; - jupyterExtensionApi.registerPythonApi({ - onDidChangeInterpreter: this.interpreterService.onDidChangeInterpreter, - getActiveInterpreter: async (resource?: Uri) => this.interpreterService.getActiveInterpreter(resource), - getInterpreterDetails: async (pythonPath: string) => - this.interpreterService.getInterpreterDetails(pythonPath), - getInterpreters: async (resource: Uri | undefined) => this.interpreterService.getInterpreters(resource), - getActivatedEnvironmentVariables: async ( - resource: Resource, - interpreter?: PythonEnvironment, - allowExceptions?: boolean - ) => this.envActivation.getActivatedEnvironmentVariables(resource, interpreter, allowExceptions), - isWindowsStoreInterpreter: async (pythonPath: string): Promise => - this.windowsStoreInterpreter.isWindowsStoreInterpreter(pythonPath), - getSuggestions: async (resource: Resource): Promise => - this.interpreterSelector.getSuggestions(resource), - install: async ( - product: Product, - resource?: InterpreterUri, - cancel?: CancellationToken - ): Promise => this.installer.install(product, resource, cancel) - }); + if (!jupyterExtension.isActive) { + return; } + const jupyterExtensionApi = jupyterExtension.exports; + jupyterExtensionApi.registerPythonApi({ + onDidChangeInterpreter: this.interpreterService.onDidChangeInterpreter, + getActiveInterpreter: async (resource?: Uri) => this.interpreterService.getActiveInterpreter(resource), + getInterpreterDetails: async (pythonPath: string) => + this.interpreterService.getInterpreterDetails(pythonPath), + getInterpreters: async (resource: Uri | undefined) => this.interpreterService.getInterpreters(resource), + getActivatedEnvironmentVariables: async ( + resource: Resource, + interpreter?: PythonEnvironment, + allowExceptions?: boolean + ) => this.envActivation.getActivatedEnvironmentVariables(resource, interpreter, allowExceptions), + isWindowsStoreInterpreter: async (pythonPath: string): Promise => + this.windowsStoreInterpreter.isWindowsStoreInterpreter(pythonPath), + getSuggestions: async (resource: Resource): Promise => + this.interpreterSelector.getSuggestions(resource), + install: async ( + product: Product, + resource?: InterpreterUri, + cancel?: CancellationToken + ): Promise => this.installer.install(product, resource, cancel) + }); } }