mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 14:01:38 +01:00
web - tweak workspace label when temporary workspace is opened
This commit is contained in:
@@ -11,7 +11,7 @@ import { Emitter } from 'vs/base/common/event';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IWorkspaceContextService, IWorkspace, isWorkspace, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION, isUntitledWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspaceContextService, IWorkspace, isWorkspace, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION, isUntitledWorkspace, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { basenameOrAuthority, basename, joinPath, dirname } from 'vs/base/common/resources';
|
||||
import { tildify, getPathLabel } from 'vs/base/common/labels';
|
||||
import { ILabelService, ResourceLabelFormatter, ResourceLabelFormatting, IFormatterChangeEvent } from 'vs/platform/label/common/label';
|
||||
@@ -236,13 +236,18 @@ export class LabelService extends Disposable implements ILabelService {
|
||||
return localize('untitledWorkspace', "Untitled (Workspace)");
|
||||
}
|
||||
|
||||
// Workspace: Temporary
|
||||
if (isTemporaryWorkspace(workspaceUri)) {
|
||||
return localize('temporaryWorkspace', "Workspace");
|
||||
}
|
||||
|
||||
// Workspace: Saved
|
||||
let filename = basename(workspaceUri);
|
||||
if (filename.endsWith(WORKSPACE_EXTENSION)) {
|
||||
filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
|
||||
}
|
||||
|
||||
let label;
|
||||
let label: string;
|
||||
if (options?.verbose) {
|
||||
label = localize('workspaceNameVerbose', "{0} (Workspace)", this.getUriLabel(joinPath(dirname(workspaceUri), filename)));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user