mirror of
https://github.com/coder/code-server.git
synced 2026-05-27 23:49:33 +00:00
Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
53
lib/vscode/src/vs/platform/label/common/label.ts
Normal file
53
lib/vscode/src/vs/platform/label/common/label.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } 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 | 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;
|
||||
}
|
||||
Reference in New Issue
Block a user