@@ -40,9 +40,10 @@ class InterpreterQuickPickItem implements IInterpreterQuickPickItem {
4040
4141 public interpreter = ( { } as unknown ) as PythonEnvironment ;
4242
43- constructor ( l : string , p : string ) {
43+ constructor ( l : string , p : string , d ?: string ) {
4444 this . path = p ;
4545 this . label = l ;
46+ this . description = d ?? p ;
4647 }
4748}
4849
@@ -85,6 +86,7 @@ suite('Interpreters - selector', () => {
8586 { displayName : '2 (virtualenv)' , path : 'c:/path2/path2' , envType : EnvironmentType . VirtualEnv } ,
8687 { displayName : '3' , path : 'c:/path2/path2' , envType : EnvironmentType . Unknown } ,
8788 { displayName : '4' , path : 'c:/path4/path4' , envType : EnvironmentType . Conda } ,
89+ { displayName : '5' , path : 'c:/path5/path' , envPath : 'c:/path5' , envType : EnvironmentType . Conda } ,
8890 ] . map ( ( item ) => ( { ...info , ...item } ) ) ;
8991 interpreterService
9092 . setup ( ( x ) => x . getAllInterpreters ( TypeMoq . It . isAny ( ) ) )
@@ -99,19 +101,25 @@ suite('Interpreters - selector', () => {
99101 new InterpreterQuickPickItem ( '2 (virtualenv)' , 'c:/path2/path2' ) ,
100102 new InterpreterQuickPickItem ( '3' , 'c:/path2/path2' ) ,
101103 new InterpreterQuickPickItem ( '4' , 'c:/path4/path4' ) ,
104+ new InterpreterQuickPickItem ( '5' , 'c:/path5/path' , 'c:/path5' ) ,
102105 ] ;
103106
104107 assert . strictEqual ( actual . length , expected . length , 'Suggestion lengths are different.' ) ;
105108 for ( let i = 0 ; i < expected . length ; i += 1 ) {
106109 assert . strictEqual (
107110 actual [ i ] . label ,
108111 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 } '.` ,
110113 ) ;
111114 assert . strictEqual (
112115 actual [ i ] . path ,
113116 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 } '.` ,
115123 ) ;
116124 }
117125 } ) ;
@@ -183,12 +191,12 @@ suite('Interpreters - selector', () => {
183191 assert . strictEqual (
184192 result [ i ] . label ,
185193 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 } '.` ,
187195 ) ;
188196 assert . strictEqual (
189197 result [ i ] . path ,
190198 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 } '.` ,
192200 ) ;
193201 }
194202 } ) ;
0 commit comments