@theia/workspace 1.45.1 → 1.46.0-next.72
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.
- package/README.md +30 -30
- package/lib/browser/canonical-uri-service.d.ts +11 -11
- package/lib/browser/canonical-uri-service.js +59 -59
- package/lib/browser/diff-service.d.ts +10 -10
- package/lib/browser/diff-service.js +85 -85
- package/lib/browser/index.d.ts +7 -7
- package/lib/browser/index.js +34 -34
- package/lib/browser/quick-open-workspace.d.ts +25 -25
- package/lib/browser/quick-open-workspace.js +137 -137
- package/lib/browser/untitled-workspace-exit-dialog.d.ts +19 -19
- package/lib/browser/untitled-workspace-exit-dialog.js +74 -74
- package/lib/browser/workspace-breadcrumbs-contribution.d.ts +10 -10
- package/lib/browser/workspace-breadcrumbs-contribution.js +66 -66
- package/lib/browser/workspace-commands.d.ts +117 -117
- package/lib/browser/workspace-commands.js +601 -601
- package/lib/browser/workspace-commands.spec.d.ts +1 -1
- package/lib/browser/workspace-commands.spec.js +127 -127
- package/lib/browser/workspace-compare-handler.d.ts +26 -26
- package/lib/browser/workspace-compare-handler.js +66 -66
- package/lib/browser/workspace-delete-handler.d.ts +75 -75
- package/lib/browser/workspace-delete-handler.js +214 -214
- package/lib/browser/workspace-duplicate-handler.d.ts +30 -30
- package/lib/browser/workspace-duplicate-handler.js +86 -86
- package/lib/browser/workspace-frontend-contribution.d.ts +110 -110
- package/lib/browser/workspace-frontend-contribution.js +546 -546
- package/lib/browser/workspace-frontend-contribution.js.map +1 -1
- package/lib/browser/workspace-frontend-module.d.ts +3 -3
- package/lib/browser/workspace-frontend-module.js +91 -91
- package/lib/browser/workspace-input-dialog.d.ts +19 -19
- package/lib/browser/workspace-input-dialog.js +74 -74
- package/lib/browser/workspace-preferences.d.ts +11 -11
- package/lib/browser/workspace-preferences.js +46 -46
- package/lib/browser/workspace-schema-updater.d.ts +34 -34
- package/lib/browser/workspace-schema-updater.js +153 -153
- package/lib/browser/workspace-service.d.ts +184 -184
- package/lib/browser/workspace-service.js +739 -739
- package/lib/browser/workspace-storage-service.d.ts +15 -15
- package/lib/browser/workspace-storage-service.js +80 -80
- package/lib/browser/workspace-trust-preferences.d.ts +21 -21
- package/lib/browser/workspace-trust-preferences.js +65 -65
- package/lib/browser/workspace-trust-service.d.ts +27 -27
- package/lib/browser/workspace-trust-service.js +152 -152
- package/lib/browser/workspace-uri-contribution.d.ts +20 -20
- package/lib/browser/workspace-uri-contribution.js +113 -113
- package/lib/browser/workspace-uri-contribution.spec.d.ts +1 -1
- package/lib/browser/workspace-uri-contribution.spec.js +169 -169
- package/lib/browser/workspace-user-working-directory-provider.d.ts +12 -12
- package/lib/browser/workspace-user-working-directory-provider.js +62 -62
- package/lib/browser/workspace-utils.d.ts +15 -15
- package/lib/browser/workspace-utils.js +54 -54
- package/lib/browser/workspace-variable-contribution.d.ts +23 -23
- package/lib/browser/workspace-variable-contribution.js +237 -237
- package/lib/browser/workspace-window-title-updater.d.ts +7 -7
- package/lib/browser/workspace-window-title-updater.js +57 -57
- package/lib/browser-only/browser-only-workspace-server.d.ts +13 -0
- package/lib/browser-only/browser-only-workspace-server.d.ts.map +1 -0
- package/lib/browser-only/browser-only-workspace-server.js +81 -0
- package/lib/browser-only/browser-only-workspace-server.js.map +1 -0
- package/lib/browser-only/workspace-frontend-only-module.d.ts +4 -0
- package/lib/browser-only/workspace-frontend-only-module.d.ts.map +1 -0
- package/lib/browser-only/workspace-frontend-only-module.js +30 -0
- package/lib/browser-only/workspace-frontend-only-module.js.map +1 -0
- package/lib/common/index.d.ts +3 -3
- package/lib/common/index.js +30 -30
- package/lib/common/test/mock-workspace-server.d.ts +7 -7
- package/lib/common/test/mock-workspace-server.js +35 -35
- package/lib/common/untitled-workspace-service.d.ts +8 -8
- package/lib/common/untitled-workspace-service.js +60 -60
- package/lib/common/workspace-file-service.d.ts +26 -26
- package/lib/common/workspace-file-service.js +71 -71
- package/lib/common/workspace-protocol.d.ts +26 -26
- package/lib/common/workspace-protocol.js +23 -23
- package/lib/node/default-workspace-server.d.ts +65 -65
- package/lib/node/default-workspace-server.js +248 -248
- package/lib/node/default-workspace-server.spec.d.ts +1 -1
- package/lib/node/default-workspace-server.spec.js +85 -85
- package/lib/node/index.d.ts +2 -2
- package/lib/node/index.js +29 -29
- package/lib/node/workspace-backend-module.d.ts +3 -3
- package/lib/node/workspace-backend-module.js +33 -33
- package/package.json +9 -6
- package/src/browser/canonical-uri-service.ts +57 -57
- package/src/browser/diff-service.ts +62 -62
- package/src/browser/index.ts +23 -23
- package/src/browser/quick-open-workspace.ts +112 -112
- package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
- package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
- package/src/browser/workspace-commands.spec.ts +153 -153
- package/src/browser/workspace-commands.ts +588 -588
- package/src/browser/workspace-compare-handler.ts +56 -56
- package/src/browser/workspace-delete-handler.ts +212 -212
- package/src/browser/workspace-duplicate-handler.ts +75 -75
- package/src/browser/workspace-frontend-contribution.ts +537 -537
- package/src/browser/workspace-frontend-module.ts +118 -118
- package/src/browser/workspace-input-dialog.ts +61 -61
- package/src/browser/workspace-preferences.ts +58 -58
- package/src/browser/workspace-schema-updater.ts +150 -150
- package/src/browser/workspace-service.ts +780 -780
- package/src/browser/workspace-storage-service.ts +67 -67
- package/src/browser/workspace-trust-preferences.ts +76 -76
- package/src/browser/workspace-trust-service.ts +147 -147
- package/src/browser/workspace-uri-contribution.spec.ts +191 -191
- package/src/browser/workspace-uri-contribution.ts +97 -97
- package/src/browser/workspace-user-working-directory-provider.ts +49 -49
- package/src/browser/workspace-utils.ts +45 -45
- package/src/browser/workspace-variable-contribution.ts +222 -222
- package/src/browser/workspace-window-title-updater.ts +45 -45
- package/src/browser-only/browser-only-workspace-server.ts +69 -0
- package/src/browser-only/workspace-frontend-only-module.ts +28 -0
- package/src/common/index.ts +19 -19
- package/src/common/test/mock-workspace-server.ts +29 -29
- package/src/common/untitled-workspace-service.ts +50 -50
- package/src/common/workspace-file-service.ts +72 -72
- package/src/common/workspace-protocol.ts +47 -47
- package/src/node/default-workspace-server.spec.ts +100 -100
- package/src/node/default-workspace-server.ts +244 -244
- package/src/node/index.ts +18 -18
- package/src/node/workspace-backend-module.ts +38 -38
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Ericsson and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.QuickOpenWorkspace = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
30
|
-
const env_variables_1 = require("@theia/core/lib/common/env-variables");
|
|
31
|
-
const workspace_service_1 = require("./workspace-service");
|
|
32
|
-
const workspace_preferences_1 = require("./workspace-preferences");
|
|
33
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
-
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
35
|
-
const common_1 = require("@theia/core/lib/common");
|
|
36
|
-
const untitled_workspace_service_1 = require("../common/untitled-workspace-service");
|
|
37
|
-
let QuickOpenWorkspace = class QuickOpenWorkspace {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.removeRecentWorkspaceButton = {
|
|
40
|
-
iconClass: 'codicon-remove-close',
|
|
41
|
-
tooltip: common_1.nls.localizeByDefault('Remove from Recently Opened')
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
async open(workspaces) {
|
|
45
|
-
var _a;
|
|
46
|
-
this.items = [];
|
|
47
|
-
const [homeDirUri] = await Promise.all([
|
|
48
|
-
this.envServer.getHomeDirUri(),
|
|
49
|
-
this.workspaceService.getUntitledWorkspace()
|
|
50
|
-
]);
|
|
51
|
-
const home = new uri_1.default(homeDirUri).path.toString();
|
|
52
|
-
await this.preferences.ready;
|
|
53
|
-
this.items.push({
|
|
54
|
-
type: 'separator',
|
|
55
|
-
label: common_1.nls.localizeByDefault('folders & workspaces')
|
|
56
|
-
});
|
|
57
|
-
for (const workspace of workspaces) {
|
|
58
|
-
const uri = new uri_1.default(workspace);
|
|
59
|
-
let stat;
|
|
60
|
-
try {
|
|
61
|
-
stat = await this.fileService.resolve(uri);
|
|
62
|
-
}
|
|
63
|
-
catch { }
|
|
64
|
-
if (this.untitledWorkspaceService.isUntitledWorkspace(uri) || !stat) {
|
|
65
|
-
continue; // skip the temporary workspace files or an undefined stat.
|
|
66
|
-
}
|
|
67
|
-
const icon = this.labelProvider.getIcon(stat);
|
|
68
|
-
const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
|
|
69
|
-
this.items.push({
|
|
70
|
-
label: uri.path.base,
|
|
71
|
-
description: common_1.Path.tildify(uri.path.toString(), home),
|
|
72
|
-
iconClasses,
|
|
73
|
-
buttons: [this.removeRecentWorkspaceButton],
|
|
74
|
-
resource: uri,
|
|
75
|
-
execute: () => {
|
|
76
|
-
const current = this.workspaceService.workspace;
|
|
77
|
-
const uriToOpen = new uri_1.default(workspace);
|
|
78
|
-
if ((current && current.resource.toString() !== workspace) || !current) {
|
|
79
|
-
this.workspaceService.open(uriToOpen);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, {
|
|
85
|
-
placeholder: common_1.nls.localize('theia/workspace/openRecentPlaceholder', 'Type the name of the workspace you want to open'),
|
|
86
|
-
onDidTriggerItemButton: async (context) => {
|
|
87
|
-
const resource = context.item.resource;
|
|
88
|
-
if (resource) {
|
|
89
|
-
await this.workspaceService.removeRecentWorkspace(resource.toString());
|
|
90
|
-
context.removeItem();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
select() {
|
|
96
|
-
this.items = [];
|
|
97
|
-
this.opened = this.workspaceService.opened;
|
|
98
|
-
this.workspaceService.recentWorkspaces().then(workspaceRoots => {
|
|
99
|
-
if (workspaceRoots) {
|
|
100
|
-
this.open(workspaceRoots);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
__decorate([
|
|
106
|
-
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
107
|
-
(0, inversify_1.optional)(),
|
|
108
|
-
__metadata("design:type", Object)
|
|
109
|
-
], QuickOpenWorkspace.prototype, "quickInputService", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
112
|
-
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
113
|
-
], QuickOpenWorkspace.prototype, "workspaceService", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, inversify_1.inject)(file_service_1.FileService),
|
|
116
|
-
__metadata("design:type", file_service_1.FileService)
|
|
117
|
-
], QuickOpenWorkspace.prototype, "fileService", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
(0, inversify_1.inject)(browser_1.LabelProvider),
|
|
120
|
-
__metadata("design:type", browser_1.LabelProvider)
|
|
121
|
-
], QuickOpenWorkspace.prototype, "labelProvider", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
(0, inversify_1.inject)(workspace_preferences_1.WorkspacePreferences),
|
|
124
|
-
__metadata("design:type", Object)
|
|
125
|
-
], QuickOpenWorkspace.prototype, "preferences", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
(0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
|
|
128
|
-
__metadata("design:type", Object)
|
|
129
|
-
], QuickOpenWorkspace.prototype, "envServer", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
(0, inversify_1.inject)(untitled_workspace_service_1.UntitledWorkspaceService),
|
|
132
|
-
__metadata("design:type", untitled_workspace_service_1.UntitledWorkspaceService)
|
|
133
|
-
], QuickOpenWorkspace.prototype, "untitledWorkspaceService", void 0);
|
|
134
|
-
QuickOpenWorkspace = __decorate([
|
|
135
|
-
(0, inversify_1.injectable)()
|
|
136
|
-
], QuickOpenWorkspace);
|
|
137
|
-
exports.QuickOpenWorkspace = QuickOpenWorkspace;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.QuickOpenWorkspace = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
30
|
+
const env_variables_1 = require("@theia/core/lib/common/env-variables");
|
|
31
|
+
const workspace_service_1 = require("./workspace-service");
|
|
32
|
+
const workspace_preferences_1 = require("./workspace-preferences");
|
|
33
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
34
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
35
|
+
const common_1 = require("@theia/core/lib/common");
|
|
36
|
+
const untitled_workspace_service_1 = require("../common/untitled-workspace-service");
|
|
37
|
+
let QuickOpenWorkspace = class QuickOpenWorkspace {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.removeRecentWorkspaceButton = {
|
|
40
|
+
iconClass: 'codicon-remove-close',
|
|
41
|
+
tooltip: common_1.nls.localizeByDefault('Remove from Recently Opened')
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async open(workspaces) {
|
|
45
|
+
var _a;
|
|
46
|
+
this.items = [];
|
|
47
|
+
const [homeDirUri] = await Promise.all([
|
|
48
|
+
this.envServer.getHomeDirUri(),
|
|
49
|
+
this.workspaceService.getUntitledWorkspace()
|
|
50
|
+
]);
|
|
51
|
+
const home = new uri_1.default(homeDirUri).path.toString();
|
|
52
|
+
await this.preferences.ready;
|
|
53
|
+
this.items.push({
|
|
54
|
+
type: 'separator',
|
|
55
|
+
label: common_1.nls.localizeByDefault('folders & workspaces')
|
|
56
|
+
});
|
|
57
|
+
for (const workspace of workspaces) {
|
|
58
|
+
const uri = new uri_1.default(workspace);
|
|
59
|
+
let stat;
|
|
60
|
+
try {
|
|
61
|
+
stat = await this.fileService.resolve(uri);
|
|
62
|
+
}
|
|
63
|
+
catch { }
|
|
64
|
+
if (this.untitledWorkspaceService.isUntitledWorkspace(uri) || !stat) {
|
|
65
|
+
continue; // skip the temporary workspace files or an undefined stat.
|
|
66
|
+
}
|
|
67
|
+
const icon = this.labelProvider.getIcon(stat);
|
|
68
|
+
const iconClasses = icon === '' ? undefined : [icon + ' file-icon'];
|
|
69
|
+
this.items.push({
|
|
70
|
+
label: uri.path.base,
|
|
71
|
+
description: common_1.Path.tildify(uri.path.toString(), home),
|
|
72
|
+
iconClasses,
|
|
73
|
+
buttons: [this.removeRecentWorkspaceButton],
|
|
74
|
+
resource: uri,
|
|
75
|
+
execute: () => {
|
|
76
|
+
const current = this.workspaceService.workspace;
|
|
77
|
+
const uriToOpen = new uri_1.default(workspace);
|
|
78
|
+
if ((current && current.resource.toString() !== workspace) || !current) {
|
|
79
|
+
this.workspaceService.open(uriToOpen);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
(_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(this.items, {
|
|
85
|
+
placeholder: common_1.nls.localize('theia/workspace/openRecentPlaceholder', 'Type the name of the workspace you want to open'),
|
|
86
|
+
onDidTriggerItemButton: async (context) => {
|
|
87
|
+
const resource = context.item.resource;
|
|
88
|
+
if (resource) {
|
|
89
|
+
await this.workspaceService.removeRecentWorkspace(resource.toString());
|
|
90
|
+
context.removeItem();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
select() {
|
|
96
|
+
this.items = [];
|
|
97
|
+
this.opened = this.workspaceService.opened;
|
|
98
|
+
this.workspaceService.recentWorkspaces().then(workspaceRoots => {
|
|
99
|
+
if (workspaceRoots) {
|
|
100
|
+
this.open(workspaceRoots);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
107
|
+
(0, inversify_1.optional)(),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], QuickOpenWorkspace.prototype, "quickInputService", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
112
|
+
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
113
|
+
], QuickOpenWorkspace.prototype, "workspaceService", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, inversify_1.inject)(file_service_1.FileService),
|
|
116
|
+
__metadata("design:type", file_service_1.FileService)
|
|
117
|
+
], QuickOpenWorkspace.prototype, "fileService", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, inversify_1.inject)(browser_1.LabelProvider),
|
|
120
|
+
__metadata("design:type", browser_1.LabelProvider)
|
|
121
|
+
], QuickOpenWorkspace.prototype, "labelProvider", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, inversify_1.inject)(workspace_preferences_1.WorkspacePreferences),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], QuickOpenWorkspace.prototype, "preferences", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
|
|
128
|
+
__metadata("design:type", Object)
|
|
129
|
+
], QuickOpenWorkspace.prototype, "envServer", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, inversify_1.inject)(untitled_workspace_service_1.UntitledWorkspaceService),
|
|
132
|
+
__metadata("design:type", untitled_workspace_service_1.UntitledWorkspaceService)
|
|
133
|
+
], QuickOpenWorkspace.prototype, "untitledWorkspaceService", void 0);
|
|
134
|
+
QuickOpenWorkspace = __decorate([
|
|
135
|
+
(0, inversify_1.injectable)()
|
|
136
|
+
], QuickOpenWorkspace);
|
|
137
|
+
exports.QuickOpenWorkspace = QuickOpenWorkspace;
|
|
138
138
|
//# sourceMappingURL=quick-open-workspace.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { AbstractDialog, DialogProps, Message } from '@theia/core/lib/browser';
|
|
2
|
-
export declare class UntitledWorkspaceExitDialog extends AbstractDialog<UntitledWorkspaceExitDialog.Options> {
|
|
3
|
-
protected readonly dontSaveButton: HTMLButtonElement;
|
|
4
|
-
protected _value: UntitledWorkspaceExitDialog.Options;
|
|
5
|
-
get value(): UntitledWorkspaceExitDialog.Options;
|
|
6
|
-
constructor(props: DialogProps);
|
|
7
|
-
protected onAfterAttach(msg: Message): void;
|
|
8
|
-
protected addAcceptAction<K extends keyof HTMLElementEventMap>(element: HTMLElement, ...additionalEventTypes: K[]): void;
|
|
9
|
-
protected dontSave(): void;
|
|
10
|
-
protected doSave(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare namespace UntitledWorkspaceExitDialog {
|
|
13
|
-
const enum Values {
|
|
14
|
-
"Don't Save" = "Don't Save",
|
|
15
|
-
Cancel = "Cancel",
|
|
16
|
-
Save = "Save"
|
|
17
|
-
}
|
|
18
|
-
type Options = keyof typeof Values;
|
|
19
|
-
}
|
|
1
|
+
import { AbstractDialog, DialogProps, Message } from '@theia/core/lib/browser';
|
|
2
|
+
export declare class UntitledWorkspaceExitDialog extends AbstractDialog<UntitledWorkspaceExitDialog.Options> {
|
|
3
|
+
protected readonly dontSaveButton: HTMLButtonElement;
|
|
4
|
+
protected _value: UntitledWorkspaceExitDialog.Options;
|
|
5
|
+
get value(): UntitledWorkspaceExitDialog.Options;
|
|
6
|
+
constructor(props: DialogProps);
|
|
7
|
+
protected onAfterAttach(msg: Message): void;
|
|
8
|
+
protected addAcceptAction<K extends keyof HTMLElementEventMap>(element: HTMLElement, ...additionalEventTypes: K[]): void;
|
|
9
|
+
protected dontSave(): void;
|
|
10
|
+
protected doSave(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace UntitledWorkspaceExitDialog {
|
|
13
|
+
const enum Values {
|
|
14
|
+
"Don't Save" = "Don't Save",
|
|
15
|
+
Cancel = "Cancel",
|
|
16
|
+
Save = "Save"
|
|
17
|
+
}
|
|
18
|
+
type Options = keyof typeof Values;
|
|
19
|
+
}
|
|
20
20
|
//# sourceMappingURL=untitled-workspace-exit-dialog.d.ts.map
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 Ericsson and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.UntitledWorkspaceExitDialog = void 0;
|
|
31
|
-
const core_1 = require("@theia/core");
|
|
32
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
34
|
-
let UntitledWorkspaceExitDialog = class UntitledWorkspaceExitDialog extends browser_1.AbstractDialog {
|
|
35
|
-
constructor(props) {
|
|
36
|
-
super(props);
|
|
37
|
-
this._value = 'Cancel';
|
|
38
|
-
const messageNode = document.createElement('div');
|
|
39
|
-
messageNode.textContent = core_1.nls.localizeByDefault('Save your workspace if you plan to open it again.');
|
|
40
|
-
this.contentNode.appendChild(messageNode);
|
|
41
|
-
this.dontSaveButton = this.createButton(core_1.nls.localizeByDefault("Don't Save" /* "Don't Save" */));
|
|
42
|
-
this.dontSaveButton.classList.add('secondary');
|
|
43
|
-
this.controlPanel.appendChild(this.dontSaveButton);
|
|
44
|
-
this.appendCloseButton(browser_1.Dialog.CANCEL);
|
|
45
|
-
this.appendAcceptButton(core_1.nls.localizeByDefault("Save" /* Save */));
|
|
46
|
-
}
|
|
47
|
-
get value() {
|
|
48
|
-
return this._value;
|
|
49
|
-
}
|
|
50
|
-
onAfterAttach(msg) {
|
|
51
|
-
super.onAfterAttach(msg);
|
|
52
|
-
this.addAction(this.dontSaveButton, () => this.dontSave(), 'click');
|
|
53
|
-
}
|
|
54
|
-
addAcceptAction(element, ...additionalEventTypes) {
|
|
55
|
-
this.addAction(element, () => this.doSave(), 'click');
|
|
56
|
-
}
|
|
57
|
-
dontSave() {
|
|
58
|
-
this._value = "Don't Save" /* "Don't Save" */;
|
|
59
|
-
this.accept();
|
|
60
|
-
}
|
|
61
|
-
doSave() {
|
|
62
|
-
this._value = "Save" /* Save */;
|
|
63
|
-
this.accept();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
UntitledWorkspaceExitDialog = __decorate([
|
|
67
|
-
__param(0, (0, inversify_1.inject)(browser_1.DialogProps)),
|
|
68
|
-
__metadata("design:paramtypes", [browser_1.DialogProps])
|
|
69
|
-
], UntitledWorkspaceExitDialog);
|
|
70
|
-
exports.UntitledWorkspaceExitDialog = UntitledWorkspaceExitDialog;
|
|
71
|
-
(function (UntitledWorkspaceExitDialog) {
|
|
72
|
-
;
|
|
73
|
-
})(UntitledWorkspaceExitDialog = exports.UntitledWorkspaceExitDialog || (exports.UntitledWorkspaceExitDialog = {}));
|
|
74
|
-
exports.UntitledWorkspaceExitDialog = UntitledWorkspaceExitDialog;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.UntitledWorkspaceExitDialog = void 0;
|
|
31
|
+
const core_1 = require("@theia/core");
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
34
|
+
let UntitledWorkspaceExitDialog = class UntitledWorkspaceExitDialog extends browser_1.AbstractDialog {
|
|
35
|
+
constructor(props) {
|
|
36
|
+
super(props);
|
|
37
|
+
this._value = 'Cancel';
|
|
38
|
+
const messageNode = document.createElement('div');
|
|
39
|
+
messageNode.textContent = core_1.nls.localizeByDefault('Save your workspace if you plan to open it again.');
|
|
40
|
+
this.contentNode.appendChild(messageNode);
|
|
41
|
+
this.dontSaveButton = this.createButton(core_1.nls.localizeByDefault("Don't Save" /* "Don't Save" */));
|
|
42
|
+
this.dontSaveButton.classList.add('secondary');
|
|
43
|
+
this.controlPanel.appendChild(this.dontSaveButton);
|
|
44
|
+
this.appendCloseButton(browser_1.Dialog.CANCEL);
|
|
45
|
+
this.appendAcceptButton(core_1.nls.localizeByDefault("Save" /* Save */));
|
|
46
|
+
}
|
|
47
|
+
get value() {
|
|
48
|
+
return this._value;
|
|
49
|
+
}
|
|
50
|
+
onAfterAttach(msg) {
|
|
51
|
+
super.onAfterAttach(msg);
|
|
52
|
+
this.addAction(this.dontSaveButton, () => this.dontSave(), 'click');
|
|
53
|
+
}
|
|
54
|
+
addAcceptAction(element, ...additionalEventTypes) {
|
|
55
|
+
this.addAction(element, () => this.doSave(), 'click');
|
|
56
|
+
}
|
|
57
|
+
dontSave() {
|
|
58
|
+
this._value = "Don't Save" /* "Don't Save" */;
|
|
59
|
+
this.accept();
|
|
60
|
+
}
|
|
61
|
+
doSave() {
|
|
62
|
+
this._value = "Save" /* Save */;
|
|
63
|
+
this.accept();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
UntitledWorkspaceExitDialog = __decorate([
|
|
67
|
+
__param(0, (0, inversify_1.inject)(browser_1.DialogProps)),
|
|
68
|
+
__metadata("design:paramtypes", [browser_1.DialogProps])
|
|
69
|
+
], UntitledWorkspaceExitDialog);
|
|
70
|
+
exports.UntitledWorkspaceExitDialog = UntitledWorkspaceExitDialog;
|
|
71
|
+
(function (UntitledWorkspaceExitDialog) {
|
|
72
|
+
;
|
|
73
|
+
})(UntitledWorkspaceExitDialog = exports.UntitledWorkspaceExitDialog || (exports.UntitledWorkspaceExitDialog = {}));
|
|
74
|
+
exports.UntitledWorkspaceExitDialog = UntitledWorkspaceExitDialog;
|
|
75
75
|
//# sourceMappingURL=untitled-workspace-exit-dialog.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FilepathBreadcrumb } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumb';
|
|
2
|
-
import { FilepathBreadcrumbClassNameFactory, FilepathBreadcrumbsContribution } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution';
|
|
3
|
-
import { WorkspaceService } from './workspace-service';
|
|
4
|
-
import URI from '@theia/core/lib/common/uri';
|
|
5
|
-
export declare class WorkspaceBreadcrumbsContribution extends FilepathBreadcrumbsContribution {
|
|
6
|
-
protected readonly workspaceService: WorkspaceService;
|
|
7
|
-
getContainerClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory;
|
|
8
|
-
getIconClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory;
|
|
9
|
-
protected filterBreadcrumbs(uri: URI, breadcrumb: FilepathBreadcrumb): boolean;
|
|
10
|
-
}
|
|
1
|
+
import { FilepathBreadcrumb } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumb';
|
|
2
|
+
import { FilepathBreadcrumbClassNameFactory, FilepathBreadcrumbsContribution } from '@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution';
|
|
3
|
+
import { WorkspaceService } from './workspace-service';
|
|
4
|
+
import URI from '@theia/core/lib/common/uri';
|
|
5
|
+
export declare class WorkspaceBreadcrumbsContribution extends FilepathBreadcrumbsContribution {
|
|
6
|
+
protected readonly workspaceService: WorkspaceService;
|
|
7
|
+
getContainerClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory;
|
|
8
|
+
getIconClassCreator(fileURI: URI): FilepathBreadcrumbClassNameFactory;
|
|
9
|
+
protected filterBreadcrumbs(uri: URI, breadcrumb: FilepathBreadcrumb): boolean;
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=workspace-breadcrumbs-contribution.d.ts.map
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2019 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.WorkspaceBreadcrumbsContribution = void 0;
|
|
28
|
-
const filepath_breadcrumbs_contribution_1 = require("@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const workspace_service_1 = require("./workspace-service");
|
|
31
|
-
let WorkspaceBreadcrumbsContribution = class WorkspaceBreadcrumbsContribution extends filepath_breadcrumbs_contribution_1.FilepathBreadcrumbsContribution {
|
|
32
|
-
getContainerClassCreator(fileURI) {
|
|
33
|
-
const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
|
|
34
|
-
return (location, index) => {
|
|
35
|
-
if (location.isEqual(fileURI)) {
|
|
36
|
-
return 'file';
|
|
37
|
-
}
|
|
38
|
-
else if (workspaceRoot === null || workspaceRoot === void 0 ? void 0 : workspaceRoot.isEqual(location)) {
|
|
39
|
-
return 'root_folder';
|
|
40
|
-
}
|
|
41
|
-
return 'folder';
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
getIconClassCreator(fileURI) {
|
|
45
|
-
const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
|
|
46
|
-
return (location, index) => {
|
|
47
|
-
if (location.isEqual(fileURI) || (workspaceRoot === null || workspaceRoot === void 0 ? void 0 : workspaceRoot.isEqual(location))) {
|
|
48
|
-
return this.labelProvider.getIcon(location) + ' file-icon';
|
|
49
|
-
}
|
|
50
|
-
return '';
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
filterBreadcrumbs(uri, breadcrumb) {
|
|
54
|
-
const workspaceRootUri = this.workspaceService.getWorkspaceRootUri(uri);
|
|
55
|
-
const firstCrumbToHide = this.workspaceService.isMultiRootWorkspaceOpened ? workspaceRootUri === null || workspaceRootUri === void 0 ? void 0 : workspaceRootUri.parent : workspaceRootUri;
|
|
56
|
-
return super.filterBreadcrumbs(uri, breadcrumb) && (!firstCrumbToHide || !breadcrumb.uri.isEqualOrParent(firstCrumbToHide));
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
61
|
-
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
62
|
-
], WorkspaceBreadcrumbsContribution.prototype, "workspaceService", void 0);
|
|
63
|
-
WorkspaceBreadcrumbsContribution = __decorate([
|
|
64
|
-
(0, inversify_1.injectable)()
|
|
65
|
-
], WorkspaceBreadcrumbsContribution);
|
|
66
|
-
exports.WorkspaceBreadcrumbsContribution = WorkspaceBreadcrumbsContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.WorkspaceBreadcrumbsContribution = void 0;
|
|
28
|
+
const filepath_breadcrumbs_contribution_1 = require("@theia/filesystem/lib/browser/breadcrumbs/filepath-breadcrumbs-contribution");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const workspace_service_1 = require("./workspace-service");
|
|
31
|
+
let WorkspaceBreadcrumbsContribution = class WorkspaceBreadcrumbsContribution extends filepath_breadcrumbs_contribution_1.FilepathBreadcrumbsContribution {
|
|
32
|
+
getContainerClassCreator(fileURI) {
|
|
33
|
+
const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
|
|
34
|
+
return (location, index) => {
|
|
35
|
+
if (location.isEqual(fileURI)) {
|
|
36
|
+
return 'file';
|
|
37
|
+
}
|
|
38
|
+
else if (workspaceRoot === null || workspaceRoot === void 0 ? void 0 : workspaceRoot.isEqual(location)) {
|
|
39
|
+
return 'root_folder';
|
|
40
|
+
}
|
|
41
|
+
return 'folder';
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
getIconClassCreator(fileURI) {
|
|
45
|
+
const workspaceRoot = this.workspaceService.getWorkspaceRootUri(fileURI);
|
|
46
|
+
return (location, index) => {
|
|
47
|
+
if (location.isEqual(fileURI) || (workspaceRoot === null || workspaceRoot === void 0 ? void 0 : workspaceRoot.isEqual(location))) {
|
|
48
|
+
return this.labelProvider.getIcon(location) + ' file-icon';
|
|
49
|
+
}
|
|
50
|
+
return '';
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
filterBreadcrumbs(uri, breadcrumb) {
|
|
54
|
+
const workspaceRootUri = this.workspaceService.getWorkspaceRootUri(uri);
|
|
55
|
+
const firstCrumbToHide = this.workspaceService.isMultiRootWorkspaceOpened ? workspaceRootUri === null || workspaceRootUri === void 0 ? void 0 : workspaceRootUri.parent : workspaceRootUri;
|
|
56
|
+
return super.filterBreadcrumbs(uri, breadcrumb) && (!firstCrumbToHide || !breadcrumb.uri.isEqualOrParent(firstCrumbToHide));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
61
|
+
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
62
|
+
], WorkspaceBreadcrumbsContribution.prototype, "workspaceService", void 0);
|
|
63
|
+
WorkspaceBreadcrumbsContribution = __decorate([
|
|
64
|
+
(0, inversify_1.injectable)()
|
|
65
|
+
], WorkspaceBreadcrumbsContribution);
|
|
66
|
+
exports.WorkspaceBreadcrumbsContribution = WorkspaceBreadcrumbsContribution;
|
|
67
67
|
//# sourceMappingURL=workspace-breadcrumbs-contribution.js.map
|