@@ -40,9 +40,10 @@ class InterpreterQuickPickItem implements IInterpreterQuickPickItem {
40
40
41
41
public interpreter = ( { } as unknown ) as PythonEnvironment ;
42
42
43
- constructor ( l : string , p : string ) {
43
+ constructor ( l : string , p : string , d ?: string ) {
44
44
this . path = p ;
45
45
this . label = l ;
46
+ this . description = d ?? p ;
46
47
}
47
48
}
48
49
@@ -85,6 +86,7 @@ suite('Interpreters - selector', () => {
85
86
{ displayName : '2 (virtualenv)' , path : 'c:/path2/path2' , envType : EnvironmentType . VirtualEnv } ,
86
87
{ displayName : '3' , path : 'c:/path2/path2' , envType : EnvironmentType . Unknown } ,
87
88
{ displayName : '4' , path : 'c:/path4/path4' , envType : EnvironmentType . Conda } ,
89
+ { displayName : '5' , path : 'c:/path5/path' , envPath : 'c:/path5' , envType : EnvironmentType . Conda } ,
88
90
] . map ( ( item ) => ( { ...info , ...item } ) ) ;
89
91
interpreterService
90
92
. setup ( ( x ) => x . getAllInterpreters ( TypeMoq . It . isAny ( ) ) )
@@ -99,19 +101,25 @@ suite('Interpreters - selector', () => {
99
101
new InterpreterQuickPickItem ( '2 (virtualenv)' , 'c:/path2/path2' ) ,
100
102
new InterpreterQuickPickItem ( '3' , 'c:/path2/path2' ) ,
101
103
new InterpreterQuickPickItem ( '4' , 'c:/path4/path4' ) ,
104
+ new InterpreterQuickPickItem ( '5' , 'c:/path5/path' , 'c:/path5' ) ,
102
105
] ;
103
106
104
107
assert . strictEqual ( actual . length , expected . length , 'Suggestion lengths are different.' ) ;
105
108
for ( let i = 0 ; i < expected . length ; i += 1 ) {
106
109
assert . strictEqual (
107
110
actual [ i ] . label ,
108
111
expected [ i ] . label ,
109
- `Suggestion label is different at ${ i } : exected '${ expected [ i ] . label } ', found '${ actual [ i ] . label } '.` ,
112
+ `Suggestion label is different at ${ i } : expected '${ expected [ i ] . label } ', found '${ actual [ i ] . label } '.` ,
110
113
) ;
111
114
assert . strictEqual (
112
115
actual [ i ] . path ,
113
116
expected [ i ] . path ,
114
- `Suggestion path is different at ${ i } : exected '${ expected [ i ] . path } ', found '${ actual [ i ] . path } '.` ,
117
+ `Suggestion path is different at ${ i } : expected '${ expected [ i ] . path } ', found '${ actual [ i ] . path } '.` ,
118
+ ) ;
119
+ assert . strictEqual (
120
+ actual [ i ] . description ,
121
+ expected [ i ] . description ,
122
+ `Suggestion description is different at ${ i } : expected '${ expected [ i ] . description } ', found '${ actual [ i ] . description } '.` ,
115
123
) ;
116
124
}
117
125
} ) ;
@@ -183,12 +191,12 @@ suite('Interpreters - selector', () => {
183
191
assert . strictEqual (
184
192
result [ i ] . label ,
185
193
expected [ i ] . label ,
186
- `Suggestion label is different at ${ i } : exected '${ expected [ i ] . label } ', found '${ result [ i ] . label } '.` ,
194
+ `Suggestion label is different at ${ i } : expected '${ expected [ i ] . label } ', found '${ result [ i ] . label } '.` ,
187
195
) ;
188
196
assert . strictEqual (
189
197
result [ i ] . path ,
190
198
expected [ i ] . path ,
191
- `Suggestion path is different at ${ i } : exected '${ expected [ i ] . path } ', found '${ result [ i ] . path } '.` ,
199
+ `Suggestion path is different at ${ i } : expected '${ expected [ i ] . path } ', found '${ result [ i ] . path } '.` ,
192
200
) ;
193
201
}
194
202
} ) ;
0 commit comments