Skip to content

Commit

Permalink
Extension API to return path to debugpy for DS (#13973)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Sep 17, 2020
1 parent 89b47a0 commit 7a86cf0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/datascience/api/jupyterIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
import { dirname } from 'path';
import { CancellationToken, Event, Uri } from 'vscode';
import { InterpreterUri } from '../../common/installer/types';
import { IExtensions, IInstaller, InstallerResponse, Product, Resource } from '../../common/types';
import { getDebugpyPackagePath } from '../../debugger/extension/adapter/remoteLaunchers';
import { IEnvironmentActivationService } from '../../interpreter/activation/types';
import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../interpreter/configuration/types';
import { IInterpreterService } from '../../interpreter/contracts';
Expand Down Expand Up @@ -51,6 +53,10 @@ type PythonApiForJupyterExtension = {
* IInstaller
*/
install(product: Product, resource?: InterpreterUri, cancel?: CancellationToken): Promise<InstallerResponse>;
/**
* Returns path to where `debugpy` is. In python extension this is `/pythonFiles/lib/python`.
*/
getDebuggerPath(): Promise<string>;
};

type JupyterExtensionApi = {
Expand Down Expand Up @@ -97,7 +103,8 @@ export class JupyterExtensionIntegration {
product: Product,
resource?: InterpreterUri,
cancel?: CancellationToken
): Promise<InstallerResponse> => this.installer.install(product, resource, cancel)
): Promise<InstallerResponse> => this.installer.install(product, resource, cancel),
getDebuggerPath: async () => dirname(getDebugpyPackagePath())
});
}
}

0 comments on commit 7a86cf0

Please sign in to comment.