File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -436,15 +436,17 @@ export function unmnemonicLabel(label: string): string {
436
436
}
437
437
438
438
/**
439
- * Splits a recent label in name and parent path, supporting both '/' and '\' and workspace suffixes
439
+ * Splits a recent label in name and parent path, supporting both '/' and '\' and workspace suffixes.
440
+ * If the location is remote, the remote name is included in the name part.
440
441
*/
441
- export function splitRecentLabel ( recentLabel : string ) {
442
+ export function splitRecentLabel ( recentLabel : string ) : { name : string ; parentPath : string } {
442
443
if ( recentLabel . endsWith ( ']' ) ) {
443
444
// label with workspace suffix
444
445
const lastIndexOfSquareBracket = recentLabel . lastIndexOf ( ' [' , recentLabel . length - 2 ) ;
445
446
if ( lastIndexOfSquareBracket !== - 1 ) {
446
447
const split = splitName ( recentLabel . substring ( 0 , lastIndexOfSquareBracket ) ) ;
447
- return { name : split . name , parentPath : split . parentPath + recentLabel . substring ( lastIndexOfSquareBracket ) } ;
448
+ const remoteNameWithSpace = recentLabel . substring ( lastIndexOfSquareBracket ) ;
449
+ return { name : split . name + remoteNameWithSpace , parentPath : split . parentPath } ;
448
450
}
449
451
}
450
452
return splitName ( recentLabel ) ;
You can’t perform that action at this time.
0 commit comments