Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Sep 14, 2020
1 parent 01d8f1d commit 0b5feb1
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/client/datascience/api/jupyterIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> =>
this.windowsStoreInterpreter.isWindowsStoreInterpreter(pythonPath),
getSuggestions: async (resource: Resource): Promise<IInterpreterQuickPickItem[]> =>
this.interpreterSelector.getSuggestions(resource),
install: async (
product: Product,
resource?: InterpreterUri,
cancel?: CancellationToken
): Promise<InstallerResponse> => 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<boolean> =>
this.windowsStoreInterpreter.isWindowsStoreInterpreter(pythonPath),
getSuggestions: async (resource: Resource): Promise<IInterpreterQuickPickItem[]> =>
this.interpreterSelector.getSuggestions(resource),
install: async (
product: Product,
resource?: InterpreterUri,
cancel?: CancellationToken
): Promise<InstallerResponse> => this.installer.install(product, resource, cancel)
});
}
}

0 comments on commit 0b5feb1

Please sign in to comment.