Skip to content

Commit 7a86cf0

Browse files
authored
Extension API to return path to debugpy for DS (#13973)
1 parent 89b47a0 commit 7a86cf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/client/datascience/api/jupyterIntegration.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
// Licensed under the MIT License.
77

88
import { inject, injectable } from 'inversify';
9+
import { dirname } from 'path';
910
import { CancellationToken, Event, Uri } from 'vscode';
1011
import { InterpreterUri } from '../../common/installer/types';
1112
import { IExtensions, IInstaller, InstallerResponse, Product, Resource } from '../../common/types';
13+
import { getDebugpyPackagePath } from '../../debugger/extension/adapter/remoteLaunchers';
1214
import { IEnvironmentActivationService } from '../../interpreter/activation/types';
1315
import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../interpreter/configuration/types';
1416
import { IInterpreterService } from '../../interpreter/contracts';
@@ -51,6 +53,10 @@ type PythonApiForJupyterExtension = {
5153
* IInstaller
5254
*/
5355
install(product: Product, resource?: InterpreterUri, cancel?: CancellationToken): Promise<InstallerResponse>;
56+
/**
57+
* Returns path to where `debugpy` is. In python extension this is `/pythonFiles/lib/python`.
58+
*/
59+
getDebuggerPath(): Promise<string>;
5460
};
5561

5662
type JupyterExtensionApi = {
@@ -97,7 +103,8 @@ export class JupyterExtensionIntegration {
97103
product: Product,
98104
resource?: InterpreterUri,
99105
cancel?: CancellationToken
100-
): Promise<InstallerResponse> => this.installer.install(product, resource, cancel)
106+
): Promise<InstallerResponse> => this.installer.install(product, resource, cancel),
107+
getDebuggerPath: async () => dirname(getDebugpyPackagePath())
101108
});
102109
}
103110
}

0 commit comments

Comments
 (0)