@@ -28,7 +28,8 @@ import { Architecture } from '../client/common/utils/platform';
28
28
import { PythonEnvCollectionChangedEvent } from '../client/pythonEnvironments/base/watcher' ;
29
29
import { normCasePath } from '../client/common/platform/fs-paths' ;
30
30
import {
31
- ActiveEnvironmentIdChangeEvent ,
31
+ ActiveEnvironmentPathChangeEvent ,
32
+ EnvironmentPath ,
32
33
EnvironmentsChangeEvent ,
33
34
ProposedExtensionAPI ,
34
35
} from '../client/proposedApiTypes' ;
@@ -74,7 +75,7 @@ suite('Proposed Extension API', () => {
74
75
} ) ;
75
76
76
77
test ( 'Provide an event to track when active environment details change' , async ( ) => {
77
- const events : ActiveEnvironmentIdChangeEvent [ ] = [ ] ;
78
+ const events : ActiveEnvironmentPathChangeEvent [ ] = [ ] ;
78
79
proposed . environment . onDidChangeActiveEnvironmentPath ( ( e ) => {
79
80
events . push ( e ) ;
80
81
} ) ;
@@ -91,7 +92,11 @@ suite('Proposed Extension API', () => {
91
92
. setup ( ( c ) => c . getSettings ( undefined ) )
92
93
. returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
93
94
const actual = proposed . environment . getActiveEnvironmentPath ( ) ;
94
- assert . deepEqual ( actual , { id : normCasePath ( pythonPath ) , path : pythonPath } ) ;
95
+ assert . deepEqual ( actual , ( {
96
+ id : normCasePath ( pythonPath ) ,
97
+ path : pythonPath ,
98
+ pathType : 'interpreterPath' ,
99
+ } as unknown ) as EnvironmentPath ) ;
95
100
} ) ;
96
101
97
102
test ( 'getActiveEnvironmentPath: default python' , ( ) => {
@@ -100,7 +105,11 @@ suite('Proposed Extension API', () => {
100
105
. setup ( ( c ) => c . getSettings ( undefined ) )
101
106
. returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
102
107
const actual = proposed . environment . getActiveEnvironmentPath ( ) ;
103
- assert . deepEqual ( actual , { id : 'DEFAULT_PYTHON' , path : pythonPath } ) ;
108
+ assert . deepEqual ( actual , ( {
109
+ id : 'DEFAULT_PYTHON' ,
110
+ path : pythonPath ,
111
+ pathType : 'interpreterPath' ,
112
+ } as unknown ) as EnvironmentPath ) ;
104
113
} ) ;
105
114
106
115
test ( 'getActiveEnvironmentPath: With resource' , ( ) => {
@@ -110,7 +119,11 @@ suite('Proposed Extension API', () => {
110
119
. setup ( ( c ) => c . getSettings ( resource ) )
111
120
. returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
112
121
const actual = proposed . environment . getActiveEnvironmentPath ( resource ) ;
113
- assert . deepEqual ( actual , { id : normCasePath ( pythonPath ) , path : pythonPath } ) ;
122
+ assert . deepEqual ( actual , ( {
123
+ id : normCasePath ( pythonPath ) ,
124
+ path : pythonPath ,
125
+ pathType : 'interpreterPath' ,
126
+ } as unknown ) as EnvironmentPath ) ;
114
127
} ) ;
115
128
116
129
test ( 'resolveEnvironment: invalid environment (when passed as string)' , async ( ) => {
0 commit comments