mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb
This commit is contained in:
@@ -8,9 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { localize } from 'vs/nls';
|
||||
import { isEqualOrParent, basename } from 'vs/base/common/resources';
|
||||
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
|
||||
export const ILabelService = createDecorator<ILabelService>('labelService');
|
||||
|
||||
@@ -52,21 +50,3 @@ export interface ResourceLabelFormatting {
|
||||
workspaceSuffix?: string;
|
||||
authorityPrefix?: string;
|
||||
}
|
||||
|
||||
export function getSimpleWorkspaceLabel(workspace: IWorkspaceIdentifier | URI, workspaceHome: URI): string {
|
||||
if (isSingleFolderWorkspaceIdentifier(workspace)) {
|
||||
return basename(workspace);
|
||||
}
|
||||
|
||||
// Workspace: Untitled
|
||||
if (isEqualOrParent(workspace.configPath, workspaceHome)) {
|
||||
return localize('untitledWorkspace', "Untitled (Workspace)");
|
||||
}
|
||||
|
||||
let filename = basename(workspace.configPath);
|
||||
if (filename.endsWith(WORKSPACE_EXTENSION)) {
|
||||
filename = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
|
||||
}
|
||||
|
||||
return localize('workspaceName', "{0} (Workspace)", filename);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user