Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/label/test/common/mockLabelService.ts
3297 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Emitter, Event } from '../../../../../base/common/event.js';
7
import { Disposable, IDisposable } from '../../../../../base/common/lifecycle.js';
8
import { basename, normalize } from '../../../../../base/common/path.js';
9
import { URI } from '../../../../../base/common/uri.js';
10
import { IFormatterChangeEvent, ILabelService, ResourceLabelFormatter, Verbosity } from '../../../../../platform/label/common/label.js';
11
import { IWorkspace, IWorkspaceIdentifier } from '../../../../../platform/workspace/common/workspace.js';
12
13
export class MockLabelService implements ILabelService {
14
_serviceBrand: undefined;
15
16
registerCachedFormatter(formatter: ResourceLabelFormatter): IDisposable {
17
throw new Error('Method not implemented.');
18
}
19
getUriLabel(resource: URI, options?: { relative?: boolean | undefined; noPrefix?: boolean | undefined }): string {
20
return normalize(resource.fsPath);
21
}
22
getUriBasenameLabel(resource: URI): string {
23
return basename(resource.fsPath);
24
}
25
getWorkspaceLabel(workspace: URI | IWorkspaceIdentifier | IWorkspace, options?: { verbose: Verbosity }): string {
26
return '';
27
}
28
getHostLabel(scheme: string, authority?: string): string {
29
return '';
30
}
31
public getHostTooltip(): string | undefined {
32
return '';
33
}
34
getSeparator(scheme: string, authority?: string): '/' | '\\' {
35
return '/';
36
}
37
registerFormatter(formatter: ResourceLabelFormatter): IDisposable {
38
return Disposable.None;
39
}
40
onDidChangeFormatters: Event<IFormatterChangeEvent> = new Emitter<IFormatterChangeEvent>().event;
41
}
42
43