@theia/workspace 1.53.0-next.5 → 1.53.0-next.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/workspace-commands.js +2 -2
  3. package/lib/browser/workspace-commands.js.map +1 -1
  4. package/lib/browser/workspace-service.js +1 -1
  5. package/lib/browser/workspace-service.js.map +1 -1
  6. package/package.json +6 -6
  7. package/src/browser/canonical-uri-service.ts +57 -57
  8. package/src/browser/diff-service.ts +62 -62
  9. package/src/browser/index.ts +23 -23
  10. package/src/browser/quick-open-workspace.ts +112 -112
  11. package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
  12. package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
  13. package/src/browser/workspace-commands.spec.ts +153 -153
  14. package/src/browser/workspace-commands.ts +557 -557
  15. package/src/browser/workspace-compare-handler.ts +56 -56
  16. package/src/browser/workspace-delete-handler.ts +212 -212
  17. package/src/browser/workspace-duplicate-handler.ts +75 -75
  18. package/src/browser/workspace-frontend-contribution.ts +537 -537
  19. package/src/browser/workspace-frontend-module.ts +118 -118
  20. package/src/browser/workspace-input-dialog.ts +61 -61
  21. package/src/browser/workspace-preferences.ts +58 -58
  22. package/src/browser/workspace-schema-updater.ts +150 -150
  23. package/src/browser/workspace-service.ts +780 -780
  24. package/src/browser/workspace-storage-service.ts +67 -67
  25. package/src/browser/workspace-trust-preferences.ts +76 -76
  26. package/src/browser/workspace-trust-service.ts +152 -152
  27. package/src/browser/workspace-uri-contribution.spec.ts +191 -191
  28. package/src/browser/workspace-uri-contribution.ts +97 -97
  29. package/src/browser/workspace-user-working-directory-provider.ts +49 -49
  30. package/src/browser/workspace-utils.ts +45 -45
  31. package/src/browser/workspace-variable-contribution.ts +222 -222
  32. package/src/browser/workspace-window-title-updater.ts +45 -45
  33. package/src/browser-only/browser-only-workspace-server.ts +69 -69
  34. package/src/browser-only/workspace-frontend-only-module.ts +28 -28
  35. package/src/common/index.ts +19 -19
  36. package/src/common/test/mock-workspace-server.ts +29 -29
  37. package/src/common/untitled-workspace-service.ts +50 -50
  38. package/src/common/workspace-file-service.ts +72 -72
  39. package/src/common/workspace-protocol.ts +47 -47
  40. package/src/node/default-workspace-server.spec.ts +100 -100
  41. package/src/node/default-workspace-server.ts +244 -244
  42. package/src/node/index.ts +18 -18
  43. package/src/node/workspace-backend-module.ts +38 -38
@@ -1,112 +1,112 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable, inject, optional } from '@theia/core/shared/inversify';
18
- import { QuickPickItem, LabelProvider, QuickInputService, QuickInputButton, QuickPickSeparator } from '@theia/core/lib/browser';
19
- import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
20
- import { WorkspaceService } from './workspace-service';
21
- import { WorkspacePreferences } from './workspace-preferences';
22
- import URI from '@theia/core/lib/common/uri';
23
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
24
- import { FileStat } from '@theia/filesystem/lib/common/files';
25
- import { nls, Path } from '@theia/core/lib/common';
26
- import { UntitledWorkspaceService } from '../common/untitled-workspace-service';
27
-
28
- interface RecentlyOpenedPick extends QuickPickItem {
29
- resource?: URI
30
- }
31
-
32
- @injectable()
33
- export class QuickOpenWorkspace {
34
- protected items: Array<RecentlyOpenedPick | QuickPickSeparator>;
35
- protected opened: boolean;
36
-
37
- @inject(QuickInputService) @optional() protected readonly quickInputService: QuickInputService;
38
- @inject(WorkspaceService) protected readonly workspaceService: WorkspaceService;
39
- @inject(FileService) protected readonly fileService: FileService;
40
- @inject(LabelProvider) protected readonly labelProvider: LabelProvider;
41
- @inject(WorkspacePreferences) protected preferences: WorkspacePreferences;
42
- @inject(EnvVariablesServer) protected readonly envServer: EnvVariablesServer;
43
- @inject(UntitledWorkspaceService) protected untitledWorkspaceService: UntitledWorkspaceService;
44
-
45
- protected readonly removeRecentWorkspaceButton: QuickInputButton = {
46
- iconClass: 'codicon-remove-close',
47
- tooltip: nls.localizeByDefault('Remove from Recently Opened')
48
- };
49
-
50
- async open(workspaces: string[]): Promise<void> {
51
- this.items = [];
52
- const [homeDirUri] = await Promise.all([
53
- this.envServer.getHomeDirUri(),
54
- this.workspaceService.getUntitledWorkspace()
55
- ]);
56
- const home = new URI(homeDirUri).path.toString();
57
- await this.preferences.ready;
58
- this.items.push({
59
- type: 'separator',
60
- label: nls.localizeByDefault('folders & workspaces')
61
- });
62
- for (const workspace of workspaces) {
63
- const uri = new URI(workspace);
64
- let stat: FileStat | undefined;
65
- try {
66
- stat = await this.fileService.resolve(uri);
67
- } catch { }
68
- if (this.untitledWorkspaceService.isUntitledWorkspace(uri) || !stat) {
69
- continue; // skip the temporary workspace files or an undefined stat.
70
- }
71
- const icon = this.labelProvider.getIcon(stat);
72
- const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
73
-
74
- this.items.push({
75
- label: uri.path.base,
76
- description: Path.tildify(uri.path.toString(), home),
77
- iconClasses,
78
- buttons: [this.removeRecentWorkspaceButton],
79
- resource: uri,
80
- execute: () => {
81
- const current = this.workspaceService.workspace;
82
- const uriToOpen = new URI(workspace);
83
- if ((current && current.resource.toString() !== workspace) || !current) {
84
- this.workspaceService.open(uriToOpen);
85
- }
86
- },
87
- });
88
- }
89
- this.quickInputService?.showQuickPick(this.items, {
90
- placeholder: nls.localize(
91
- 'theia/workspace/openRecentPlaceholder',
92
- 'Type the name of the workspace you want to open'),
93
- onDidTriggerItemButton: async context => {
94
- const resource = (context.item as RecentlyOpenedPick).resource;
95
- if (resource) {
96
- await this.workspaceService.removeRecentWorkspace(resource.toString());
97
- context.removeItem();
98
- }
99
- }
100
- });
101
- }
102
-
103
- select(): void {
104
- this.items = [];
105
- this.opened = this.workspaceService.opened;
106
- this.workspaceService.recentWorkspaces().then(workspaceRoots => {
107
- if (workspaceRoots) {
108
- this.open(workspaceRoots);
109
- }
110
- });
111
- }
112
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable, inject, optional } from '@theia/core/shared/inversify';
18
+ import { QuickPickItem, LabelProvider, QuickInputService, QuickInputButton, QuickPickSeparator } from '@theia/core/lib/browser';
19
+ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
20
+ import { WorkspaceService } from './workspace-service';
21
+ import { WorkspacePreferences } from './workspace-preferences';
22
+ import URI from '@theia/core/lib/common/uri';
23
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
24
+ import { FileStat } from '@theia/filesystem/lib/common/files';
25
+ import { nls, Path } from '@theia/core/lib/common';
26
+ import { UntitledWorkspaceService } from '../common/untitled-workspace-service';
27
+
28
+ interface RecentlyOpenedPick extends QuickPickItem {
29
+ resource?: URI
30
+ }
31
+
32
+ @injectable()
33
+ export class QuickOpenWorkspace {
34
+ protected items: Array<RecentlyOpenedPick | QuickPickSeparator>;
35
+ protected opened: boolean;
36
+
37
+ @inject(QuickInputService) @optional() protected readonly quickInputService: QuickInputService;
38
+ @inject(WorkspaceService) protected readonly workspaceService: WorkspaceService;
39
+ @inject(FileService) protected readonly fileService: FileService;
40
+ @inject(LabelProvider) protected readonly labelProvider: LabelProvider;
41
+ @inject(WorkspacePreferences) protected preferences: WorkspacePreferences;
42
+ @inject(EnvVariablesServer) protected readonly envServer: EnvVariablesServer;
43
+ @inject(UntitledWorkspaceService) protected untitledWorkspaceService: UntitledWorkspaceService;
44
+
45
+ protected readonly removeRecentWorkspaceButton: QuickInputButton = {
46
+ iconClass: 'codicon-remove-close',
47
+ tooltip: nls.localizeByDefault('Remove from Recently Opened')
48
+ };
49
+
50
+ async open(workspaces: string[]): Promise<void> {
51
+ this.items = [];
52
+ const [homeDirUri] = await Promise.all([
53
+ this.envServer.getHomeDirUri(),
54
+ this.workspaceService.getUntitledWorkspace()
55
+ ]);
56
+ const home = new URI(homeDirUri).path.toString();
57
+ await this.preferences.ready;
58
+ this.items.push({
59
+ type: 'separator',
60
+ label: nls.localizeByDefault('folders & workspaces')
61
+ });
62
+ for (const workspace of workspaces) {
63
+ const uri = new URI(workspace);
64
+ let stat: FileStat | undefined;
65
+ try {
66
+ stat = await this.fileService.resolve(uri);
67
+ } catch { }
68
+ if (this.untitledWorkspaceService.isUntitledWorkspace(uri) || !stat) {
69
+ continue; // skip the temporary workspace files or an undefined stat.
70
+ }
71
+ const icon = this.labelProvider.getIcon(stat);
72
+ const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
73
+
74
+ this.items.push({
75
+ label: uri.path.base,
76
+ description: Path.tildify(uri.path.toString(), home),
77
+ iconClasses,
78
+ buttons: [this.removeRecentWorkspaceButton],
79
+ resource: uri,
80
+ execute: () => {
81
+ const current = this.workspaceService.workspace;
82
+ const uriToOpen = new URI(workspace);
83
+ if ((current && current.resource.toString() !== workspace) || !current) {
84
+ this.workspaceService.open(uriToOpen);
85
+ }
86
+ },
87
+ });
88
+ }
89
+ this.quickInputService?.showQuickPick(this.items, {
90
+ placeholder: nls.localize(
91
+ 'theia/workspace/openRecentPlaceholder',
92
+ 'Type the name of the workspace you want to open'),
93
+ onDidTriggerItemButton: async context => {
94
+ const resource = (context.item as RecentlyOpenedPick).resource;
95
+ if (resource) {
96
+ await this.workspaceService.removeRecentWorkspace(resource.toString());
97
+ context.removeItem();
98
+ }
99
+ }
100
+ });
101
+ }
102
+
103
+ select(): void {
104
+ this.items = [];
105
+ this.opened = this.workspaceService.opened;
106
+ this.workspaceService.recentWorkspaces().then(workspaceRoots => {
107
+ if (workspaceRoots) {
108
+ this.open(workspaceRoots);
109
+ }
110
+ });
111
+ }
112
+ }
@@ -1,70 +1,70 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { nls } from '@theia/core';
18
- import { inject } from '@theia/core/shared/inversify';
19
- import { AbstractDialog, Dialog, DialogProps, Message } from '@theia/core/lib/browser';
20
-
21
- export class UntitledWorkspaceExitDialog extends AbstractDialog<UntitledWorkspaceExitDialog.Options> {
22
- protected readonly dontSaveButton: HTMLButtonElement;
23
- protected _value: UntitledWorkspaceExitDialog.Options = 'Cancel';
24
-
25
- get value(): UntitledWorkspaceExitDialog.Options {
26
- return this._value;
27
- }
28
-
29
- constructor(
30
- @inject(DialogProps) props: DialogProps
31
- ) {
32
- super(props);
33
- const messageNode = document.createElement('div');
34
- messageNode.textContent = nls.localizeByDefault('Save your workspace if you plan to open it again.');
35
- this.contentNode.appendChild(messageNode);
36
- this.dontSaveButton = this.createButton(nls.localizeByDefault(UntitledWorkspaceExitDialog.Values["Don't Save"]));
37
- this.dontSaveButton.classList.add('secondary');
38
- this.controlPanel.appendChild(this.dontSaveButton);
39
- this.appendCloseButton(Dialog.CANCEL);
40
- this.appendAcceptButton(nls.localizeByDefault(UntitledWorkspaceExitDialog.Values.Save));
41
- }
42
-
43
- protected override onAfterAttach(msg: Message): void {
44
- super.onAfterAttach(msg);
45
- this.addAction(this.dontSaveButton, () => this.dontSave(), 'click');
46
- }
47
-
48
- protected override addAcceptAction<K extends keyof HTMLElementEventMap>(element: HTMLElement, ...additionalEventTypes: K[]): void {
49
- this.addAction(element, () => this.doSave(), 'click');
50
- }
51
-
52
- protected dontSave(): void {
53
- this._value = UntitledWorkspaceExitDialog.Values["Don't Save"];
54
- this.accept();
55
- }
56
-
57
- protected doSave(): void {
58
- this._value = UntitledWorkspaceExitDialog.Values.Save;
59
- this.accept();
60
- }
61
- }
62
-
63
- export namespace UntitledWorkspaceExitDialog {
64
- export const enum Values {
65
- "Don't Save" = "Don't Save",
66
- Cancel = 'Cancel',
67
- Save = 'Save',
68
- };
69
- export type Options = keyof typeof Values;
70
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { nls } from '@theia/core';
18
+ import { inject } from '@theia/core/shared/inversify';
19
+ import { AbstractDialog, Dialog, DialogProps, Message } from '@theia/core/lib/browser';
20
+
21
+ export class UntitledWorkspaceExitDialog extends AbstractDialog<UntitledWorkspaceExitDialog.Options> {
22
+ protected readonly dontSaveButton: HTMLButtonElement;
23
+ protected _value: UntitledWorkspaceExitDialog.Options = 'Cancel';
24
+
25
+ get value(): UntitledWorkspaceExitDialog.Options {
26
+ return this._value;
27
+ }
28
+
29
+ constructor(
30
+ @inject(DialogProps) props: DialogProps
31
+ ) {
32
+ super(props);
33
+ const messageNode = document.createElement('div');
34
+ messageNode.textContent = nls.localizeByDefault('Save your workspace if you plan to open it again.');
35
+ this.contentNode.appendChild(messageNode);
36
+ this.dontSaveButton = this.createButton(nls.localizeByDefault(UntitledWorkspaceExitDialog.Values["Don't Save"]));
37
+ this.dontSaveButton.classList.add('secondary');
38
+ this.controlPanel.appendChild(this.dontSaveButton);
39
+ this.appendCloseButton(Dialog.CANCEL);
40
+ this.appendAcceptButton(nls.localizeByDefault(UntitledWorkspaceExitDialog.Values.Save));
41
+ }
42
+
43
+ protected override onAfterAttach(msg: Message): void {
44
+ super.onAfterAttach(msg);
45
+ this.addAction(this.dontSaveButton, () => this.dontSave(), 'click');
46
+ }
47
+
48
+ protected override addAcceptAction<K extends keyof HTMLElementEventMap>(element: HTMLElement, ...additionalEventTypes: K[]): void {
49
+ this.addAction(element, () => this.doSave(), 'click');
50
+ }
51
+
52
+ protected dontSave(): void {
53
+ this._value = UntitledWorkspaceExitDialog.Values["Don't Save"];
54
+ this.accept();
55
+ }
56
+
57
+ protected doSave(): void {
58
+ this._value = UntitledWorkspaceExitDialog.Values.Save;
59
+ this.accept();
60
+ }
61
+ }
62
+
63
+ export namespace UntitledWorkspaceExitDialog {
64
+ export const enum Values {
65
+ "Don't Save" = "Don't Save",
66
+ Cancel = 'Cancel',
67
+ Save = 'Save',
68
+ };
69
+ export type Options = keyof typeof Values;
70
+ }
@@ -1,56 +1,56 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { FilepathBreadcrumb } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumb';
18
- import { FilepathBreadcrumbClassNameFactory, FilepathBreadcrumbsContribution } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution';
19
- import { inject, injectable } from '@theia/core/shared/inversify';
20
- import { WorkspaceService } from './workspace-service';
21
- import URI from '@theia/core/lib/common/uri';
22
-
23
- @injectable()
24
- export class WorkspaceBreadcrumbsContribution extends FilepathBreadcrumbsContribution {
25
-
26
- @inject(WorkspaceService)
27
- protected readonly workspaceService: WorkspaceService;
28
-
29
- override getContainerClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory {
30
- const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
31
- return (location, index) => {
32
- if (location.isEqual(fileURI)) {
33
- return 'file';
34
- } else if (workspaceRoot?.isEqual(location)) {
35
- return 'root_folder';
36
- }
37
- return 'folder';
38
- };
39
- }
40
-
41
- override getIconClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory {
42
- const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
43
- return (location, index) => {
44
- if (location.isEqual(fileURI) || workspaceRoot?.isEqual(location)) {
45
- return this.labelProvider.getIcon(location) + ' file-icon';
46
- }
47
- return '';
48
- };
49
- }
50
-
51
- protected override filterBreadcrumbs(uri: URI, breadcrumb: FilepathBreadcrumb): boolean {
52
- const workspaceRootUri = this.workspaceService.getWorkspaceRootUri(uri);
53
- const firstCrumbToHide = this.workspaceService.isMultiRootWorkspaceOpened ? workspaceRootUri?.parent : workspaceRootUri;
54
- return super.filterBreadcrumbs(uri, breadcrumb) && (!firstCrumbToHide || !breadcrumb.uri.isEqualOrParent(firstCrumbToHide));
55
- }
56
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { FilepathBreadcrumb } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumb';
18
+ import { FilepathBreadcrumbClassNameFactory, FilepathBreadcrumbsContribution } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution';
19
+ import { inject, injectable } from '@theia/core/shared/inversify';
20
+ import { WorkspaceService } from './workspace-service';
21
+ import URI from '@theia/core/lib/common/uri';
22
+
23
+ @injectable()
24
+ export class WorkspaceBreadcrumbsContribution extends FilepathBreadcrumbsContribution {
25
+
26
+ @inject(WorkspaceService)
27
+ protected readonly workspaceService: WorkspaceService;
28
+
29
+ override getContainerClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory {
30
+ const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
31
+ return (location, index) => {
32
+ if (location.isEqual(fileURI)) {
33
+ return 'file';
34
+ } else if (workspaceRoot?.isEqual(location)) {
35
+ return 'root_folder';
36
+ }
37
+ return 'folder';
38
+ };
39
+ }
40
+
41
+ override getIconClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory {
42
+ const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
43
+ return (location, index) => {
44
+ if (location.isEqual(fileURI) || workspaceRoot?.isEqual(location)) {
45
+ return this.labelProvider.getIcon(location) + ' file-icon';
46
+ }
47
+ return '';
48
+ };
49
+ }
50
+
51
+ protected override filterBreadcrumbs(uri: URI, breadcrumb: FilepathBreadcrumb): boolean {
52
+ const workspaceRootUri = this.workspaceService.getWorkspaceRootUri(uri);
53
+ const firstCrumbToHide = this.workspaceService.isMultiRootWorkspaceOpened ? workspaceRootUri?.parent : workspaceRootUri;
54
+ return super.filterBreadcrumbs(uri, breadcrumb) && (!firstCrumbToHide || !breadcrumb.uri.isEqualOrParent(firstCrumbToHide));
55
+ }
56
+ }