|
3 | 3 |
|
4 | 4 | 'use strict'; |
5 | 5 |
|
6 | | -import { DebugAdapterDescriptorFactory as DebugAdapterExperiment } from './common/experimentGroups'; |
| 6 | +import { DebugAdapterDescriptorFactory as DebugAdapterExperiment, DebugAdapterNewPtvsd } from './common/experimentGroups'; |
7 | 7 | import { traceError } from './common/logger'; |
8 | | -import { IConfigurationService, IExperimentsManager } from './common/types'; |
| 8 | +import { IExperimentsManager } from './common/types'; |
9 | 9 | import { RemoteDebuggerExternalLauncherScriptProvider } from './debugger/debugAdapter/DebugClients/launcherProvider'; |
10 | 10 | import { IDebugAdapterDescriptorFactory } from './debugger/extension/types'; |
11 | 11 |
|
@@ -36,25 +36,24 @@ export interface IExtensionApi { |
36 | 36 | } |
37 | 37 |
|
38 | 38 | // tslint:disable-next-line:no-any |
39 | | -export function buildApi(ready: Promise<any>, experimentsManager: IExperimentsManager, debugFactory: IDebugAdapterDescriptorFactory, configuration: IConfigurationService) { |
| 39 | +export function buildApi(ready: Promise<any>, experimentsManager: IExperimentsManager, debugFactory: IDebugAdapterDescriptorFactory) { |
40 | 40 | return { |
41 | | - // 'ready' will propogate the exception, but we must log it here first. |
| 41 | + // 'ready' will propagate the exception, but we must log it here first. |
42 | 42 | ready: ready.catch((ex) => { |
43 | 43 | traceError('Failure during activation.', ex); |
44 | 44 | return Promise.reject(ex); |
45 | 45 | }), |
46 | 46 | debug: { |
47 | 47 | async getRemoteLauncherCommand(host: string, port: number, waitUntilDebuggerAttaches: boolean = true): Promise<string[]> { |
48 | | - const pythonSettings = configuration.getSettings(undefined); |
49 | | - const useNewDAPtvsd = experimentsManager.inExperiment(DebugAdapterExperiment.experiment) && (await debugFactory.useNewPtvsd(pythonSettings.pythonPath)); |
| 48 | + const useNewDAPtvsd = experimentsManager.inExperiment(DebugAdapterExperiment.experiment) && experimentsManager.inExperiment(DebugAdapterNewPtvsd.experiment); |
50 | 49 |
|
51 | | - if (!useNewDAPtvsd) { |
52 | | - return new RemoteDebuggerExternalLauncherScriptProvider().getLauncherArgs({ host, port, waitUntilDebuggerAttaches }); |
| 50 | + if (useNewDAPtvsd) { |
| 51 | + // Same logic as in RemoteDebuggerExternalLauncherScriptProvider, but eventually launcherProvider.ts will be deleted. |
| 52 | + const args = debugFactory.getRemotePtvsdArgs({ host, port, waitUntilDebuggerAttaches }); |
| 53 | + return [debugFactory.getPtvsdPath(), ...args]; |
53 | 54 | } |
54 | 55 |
|
55 | | - // Same logic as in RemoteDebuggerExternalLauncherScriptProvider, but eventually launcherProvider.ts will be deleted. |
56 | | - const args = debugFactory.getRemotePtvsdArgs({ host, port, waitUntilDebuggerAttaches }); |
57 | | - return [debugFactory.getPtvsdPath(), ...args]; |
| 56 | + return new RemoteDebuggerExternalLauncherScriptProvider().getLauncherArgs({ host, port, waitUntilDebuggerAttaches }); |
58 | 57 | } |
59 | 58 | } |
60 | 59 | }; |
|
0 commit comments