@@ -33,7 +33,7 @@ suite('Debugging - Adapter Factory', () => {
33
33
let showErrorMessageStub : sinon . SinonStub ;
34
34
let resolveEnvironmentStub : sinon . SinonStub ;
35
35
let getInterpretersStub : sinon . SinonStub ;
36
- let getActiveEnvironmentPathStub : sinon . SinonStub ;
36
+ let getInterpreterDetailsStub : sinon . SinonStub ;
37
37
let hasInterpretersStub : sinon . SinonStub ;
38
38
39
39
const nodeExecutable = undefined ;
@@ -71,7 +71,7 @@ suite('Debugging - Adapter Factory', () => {
71
71
showErrorMessageStub = sinon . stub ( vscodeApi , 'showErrorMessage' ) ;
72
72
resolveEnvironmentStub = sinon . stub ( pythonApi , 'resolveEnvironment' ) ;
73
73
getInterpretersStub = sinon . stub ( pythonApi , 'getInterpreters' ) ;
74
- getActiveEnvironmentPathStub = sinon . stub ( pythonApi , 'getActiveEnvironmentPath ' ) ;
74
+ getInterpreterDetailsStub = sinon . stub ( pythonApi , 'getInterpreterDetails ' ) ;
75
75
hasInterpretersStub = sinon . stub ( pythonApi , 'hasInterpreters' ) ;
76
76
77
77
when (
@@ -119,15 +119,15 @@ suite('Debugging - Adapter Factory', () => {
119
119
test ( 'Return the path of the active interpreter as the current python path, it exists and configuration.pythonPath is not defined' , async ( ) => {
120
120
const session = createSession ( { } ) ;
121
121
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ debugAdapterPath ] ) ;
122
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
122
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
123
123
resolveEnvironmentStub . resolves ( interpreter ) ;
124
124
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
125
125
126
126
assert . deepStrictEqual ( descriptor , debugExecutable ) ;
127
127
} ) ;
128
128
129
129
test ( 'Display a message if no python interpreter is set' , async ( ) => {
130
- getActiveEnvironmentPathStub . resolves ( undefined ) ;
130
+ getInterpreterDetailsStub . resolves ( undefined ) ;
131
131
const session = createSession ( { } ) ;
132
132
const promise = factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
133
133
@@ -149,7 +149,7 @@ suite('Debugging - Adapter Factory', () => {
149
149
version : new SemVer ( '3.6.12-test' ) ,
150
150
} ;
151
151
when ( state . value ) . thenReturn ( false ) ;
152
- getActiveEnvironmentPathStub . resolves ( deprecatedInterpreter . path ) ;
152
+ getInterpreterDetailsStub . resolves ( { path : [ deprecatedInterpreter . path ] } ) ;
153
153
resolveEnvironmentStub . resolves ( deprecatedInterpreter ) ;
154
154
155
155
await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -195,7 +195,7 @@ suite('Debugging - Adapter Factory', () => {
195
195
test ( 'Return Debug Adapter executable if request is "attach", and listen is specified' , async ( ) => {
196
196
const session = createSession ( { request : 'attach' , listen : { port : 5678 , host : 'localhost' } } ) ;
197
197
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ debugAdapterPath ] ) ;
198
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
198
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
199
199
resolveEnvironmentStub . resolves ( interpreter ) ;
200
200
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
201
201
@@ -226,7 +226,7 @@ suite('Debugging - Adapter Factory', () => {
226
226
EXTENSION_ROOT_DIR ,
227
227
] ) ;
228
228
229
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
229
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
230
230
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
231
231
232
232
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -238,7 +238,7 @@ suite('Debugging - Adapter Factory', () => {
238
238
const session = createSession ( { } ) ;
239
239
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ debugAdapterPath ] ) ;
240
240
241
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
241
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
242
242
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
243
243
244
244
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -250,7 +250,7 @@ suite('Debugging - Adapter Factory', () => {
250
250
const session = createSession ( { logToFile : false } ) ;
251
251
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ debugAdapterPath ] ) ;
252
252
253
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
253
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
254
254
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
255
255
256
256
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -260,7 +260,7 @@ suite('Debugging - Adapter Factory', () => {
260
260
261
261
test ( 'Send attach to local process telemetry if attaching to a local process' , async ( ) => {
262
262
const session = createSession ( { request : 'attach' , processId : 1234 } ) ;
263
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
263
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
264
264
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
265
265
266
266
await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -270,7 +270,7 @@ suite('Debugging - Adapter Factory', () => {
270
270
271
271
test ( "Don't send any telemetry if not attaching to a local process" , async ( ) => {
272
272
const session = createSession ( { } ) ;
273
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
273
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
274
274
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
275
275
276
276
await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
@@ -282,7 +282,7 @@ suite('Debugging - Adapter Factory', () => {
282
282
const customAdapterPath = 'custom/debug/adapter/path' ;
283
283
const session = createSession ( { debugAdapterPath : customAdapterPath } ) ;
284
284
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ customAdapterPath ] ) ;
285
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
285
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
286
286
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
287
287
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
288
288
@@ -310,7 +310,7 @@ suite('Debugging - Adapter Factory', () => {
310
310
test ( 'Do not use "python" to spawn the debug adapter' , async ( ) => {
311
311
const session = createSession ( { python : '/bin/custompy' } ) ;
312
312
const debugExecutable = new DebugAdapterExecutable ( pythonPath , [ debugAdapterPath ] ) ;
313
- getActiveEnvironmentPathStub . resolves ( interpreter . path ) ;
313
+ getInterpreterDetailsStub . resolves ( { path : [ interpreter . path ] } ) ;
314
314
resolveEnvironmentStub . withArgs ( interpreter . path ) . resolves ( interpreter ) ;
315
315
const descriptor = await factory . createDebugAdapterDescriptor ( session , nodeExecutable ) ;
316
316
0 commit comments