Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not show ssh tag after VS code update from 1.78.2 #201125

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/vs/base/common/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,17 @@ export function unmnemonicLabel(label: string): string {
}

/**
* Splits a recent label in name and parent path, supporting both '/' and '\' and workspace suffixes
* Splits a recent label in name and parent path, supporting both '/' and '\' and workspace suffixes.
* If the location is remote, the remote name is included in the name part.
*/
export function splitRecentLabel(recentLabel: string) {
export function splitRecentLabel(recentLabel: string): { name: string; parentPath: string } {
if (recentLabel.endsWith(']')) {
// label with workspace suffix
const lastIndexOfSquareBracket = recentLabel.lastIndexOf(' [', recentLabel.length - 2);
if (lastIndexOfSquareBracket !== -1) {
const split = splitName(recentLabel.substring(0, lastIndexOfSquareBracket));
return { name: split.name, parentPath: split.parentPath + recentLabel.substring(lastIndexOfSquareBracket) };
const remoteNameWithSpace = recentLabel.substring(lastIndexOfSquareBracket);
return { name: split.name + remoteNameWithSpace, parentPath: split.parentPath };
}
}
return splitName(recentLabel);
Expand Down