@@ -53,30 +53,28 @@ function fromDevEnv(env: codecatalyst.DevEnvironment): Omit<DataQuickPickItem<un
53
53
const labelParts = [ ] as string [ ]
54
54
55
55
if ( env . status === 'RUNNING' ) {
56
- labelParts . push ( '$(pass) ' )
56
+ labelParts . push ( '$(pass)' )
57
57
} else {
58
- labelParts . push ( '$(circle-slash) ' ) // TODO(sijaden): get actual 'stopped' icon
58
+ labelParts . push ( '$(circle-slash)' ) // TODO(sijaden): get actual 'stopped' icon
59
59
}
60
60
61
- const repo = env . repositories [ 0 ]
62
-
63
- if ( repo ) {
64
- const branchName = repo . branchName ?. replace ( 'refs/heads/' , '' )
65
- labelParts . push ( branchName ? `${ repo . repositoryName } /${ branchName } ` : repo . repositoryName )
66
- } else {
67
- labelParts . push ( `${ env . id } (no repository)` )
68
- }
61
+ labelParts . push ( env . alias ? env . alias : env . id )
69
62
70
- if ( env . alias ) {
71
- labelParts . push ( ` ${ env . alias } ` )
72
- }
63
+ const repo = env . repositories [ 0 ]
64
+ const branchName = repo ?. branchName ?. replace ( 'refs/heads/' , '' )
65
+ const repoLabel = repo
66
+ ? branchName
67
+ ? `${ repo . repositoryName } /${ branchName } `
68
+ : repo . repositoryName
69
+ : '(no repository)'
73
70
74
- const lastUsed = `Last used: ${ getRelativeDate ( env . lastUpdatedTime ) } `
71
+ const statusLabel = env . status === 'RUNNING' ? 'RUNNING - IN USE' : env . status
72
+ const desc = `${ statusLabel } ${ getRelativeDate ( env . lastUpdatedTime ) } `
75
73
76
74
return {
77
- label : labelParts . join ( '' ) ,
78
- description : env . status === 'RUNNING' ? 'RUNNING - IN USE' : env . status ,
79
- detail : `${ env . org . name } /${ env . project . name } , ${ lastUsed } ` ,
75
+ label : labelParts . join ( ' ' ) ,
76
+ description : desc ,
77
+ detail : `${ env . org . name } /${ env . project . name } / ${ repoLabel } ` ,
80
78
}
81
79
}
82
80
@@ -90,6 +88,7 @@ function createResourcePrompter<T extends codecatalyst.CodeCatalystResource>(
90
88
const prompter = createQuickPick ( items , {
91
89
buttons : [ refresh , ...createCommonButtons ( helpUri ) ] ,
92
90
...presentation ,
91
+ matchOnDetail : true ,
93
92
} )
94
93
95
94
refresh . onClick = ( ) => {
@@ -154,11 +153,7 @@ export function createDevEnvPrompter(
154
153
placeholder : 'Search for a Dev Environment' ,
155
154
compare : ( a , b ) => {
156
155
if ( isData ( a . data ) && isData ( b . data ) ) {
157
- if ( a . data . status === b . data . status ) {
158
- return b . data . lastUpdatedTime . getTime ( ) - a . data . lastUpdatedTime . getTime ( )
159
- }
160
-
161
- return a . data . status === 'RUNNING' ? 1 : b . data . status === 'RUNNING' ? - 1 : 0
156
+ return b . data . lastUpdatedTime . getTime ( ) - a . data . lastUpdatedTime . getTime ( )
162
157
}
163
158
164
159
return 0
0 commit comments