|
6 | 6 | // Licensed under the MIT License. |
7 | 7 |
|
8 | 8 | import { inject, injectable } from 'inversify'; |
| 9 | +import { dirname } from 'path'; |
9 | 10 | import { CancellationToken, Event, Uri } from 'vscode'; |
10 | 11 | import { InterpreterUri } from '../../common/installer/types'; |
11 | 12 | import { IExtensions, IInstaller, InstallerResponse, Product, Resource } from '../../common/types'; |
| 13 | +import { getDebugpyPackagePath } from '../../debugger/extension/adapter/remoteLaunchers'; |
12 | 14 | import { IEnvironmentActivationService } from '../../interpreter/activation/types'; |
13 | 15 | import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../interpreter/configuration/types'; |
14 | 16 | import { IInterpreterService } from '../../interpreter/contracts'; |
@@ -51,6 +53,10 @@ type PythonApiForJupyterExtension = { |
51 | 53 | * IInstaller |
52 | 54 | */ |
53 | 55 | 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>; |
54 | 60 | }; |
55 | 61 |
|
56 | 62 | type JupyterExtensionApi = { |
@@ -97,7 +103,8 @@ export class JupyterExtensionIntegration { |
97 | 103 | product: Product, |
98 | 104 | resource?: InterpreterUri, |
99 | 105 | 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()) |
101 | 108 | }); |
102 | 109 | } |
103 | 110 | } |
0 commit comments