code-server/lib/vscode/src/vs/platform/label/common/label.ts
Joe Previte eae5d8c807
chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so
that PR review is possible.
2021-02-25 11:27:27 -07:00

54 lines
2.2 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { URI } from 'vs/base/common/uri';
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 { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
export const ILabelService = createDecorator<ILabelService>('labelService');
export interface ILabelService {
readonly _serviceBrand: undefined;
/**
* Gets the human readable label for a uri.
* If relative is passed returns a label relative to the workspace root that the uri belongs to.
* If noPrefix is passed does not tildify the label and also does not prepand the root name for relative labels in a multi root scenario.
*/
getUriLabel(resource: URI, options?: { relative?: boolean, noPrefix?: boolean, endWithSeparator?: boolean }): string;
getUriBasenameLabel(resource: URI): string;
getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | URI | IWorkspace), options?: { verbose: boolean }): string;
getHostLabel(scheme: string, authority?: string): string;
getSeparator(scheme: string, authority?: string): '/' | '\\';
registerFormatter(formatter: ResourceLabelFormatter): IDisposable;
onDidChangeFormatters: Event<IFormatterChangeEvent>;
}
export interface IFormatterChangeEvent {
scheme: string;
}
export interface ResourceLabelFormatter {
scheme: string;
authority?: string;
priority?: boolean;
formatting: ResourceLabelFormatting;
}
export interface ResourceLabelFormatting {
label: string; // myLabel:/${path}
separator: '/' | '\\' | '';
tildify?: boolean;
normalizeDriveLetter?: boolean;
workspaceSuffix?: string;
authorityPrefix?: string;
stripPathStartingSeparator?: boolean;
}