@theia/workspace 1.34.3 → 1.34.4
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/LICENSE +641 -641
- package/README.md +30 -30
- package/lib/browser/diff-service.d.ts +10 -10
- package/lib/browser/diff-service.js +85 -85
- package/lib/browser/index.d.ts +6 -6
- package/lib/browser/index.js +33 -33
- 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 +593 -593
- 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 +135 -135
- package/lib/browser/workspace-frontend-contribution.js +568 -568
- package/lib/browser/workspace-frontend-contribution.spec.d.ts +1 -1
- package/lib/browser/workspace-frontend-contribution.spec.js +53 -53
- package/lib/browser/workspace-frontend-module.d.ts +3 -3
- package/lib/browser/workspace-frontend-module.js +88 -88
- package/lib/browser/workspace-input-dialog.d.ts +19 -19
- package/lib/browser/workspace-input-dialog.js +73 -73
- 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 +32 -32
- package/lib/browser/workspace-schema-updater.js +148 -148
- package/lib/browser/workspace-service.d.ts +182 -182
- package/lib/browser/workspace-service.js +729 -729
- 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 +26 -26
- package/lib/browser/workspace-trust-service.js +149 -149
- 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/common/index.d.ts +2 -2
- package/lib/common/index.js +29 -29
- package/lib/common/test/mock-workspace-server.d.ts +7 -7
- package/lib/common/test/mock-workspace-server.js +35 -35
- package/lib/common/utils.d.ts +21 -21
- package/lib/common/utils.js +73 -73
- 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 +64 -64
- 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 +84 -84
- 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 +32 -32
- package/package.json +6 -6
- package/src/browser/diff-service.ts +62 -62
- package/src/browser/index.ts +22 -22
- 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 +586 -586
- 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.spec.ts +63 -63
- package/src/browser/workspace-frontend-contribution.ts +558 -558
- package/src/browser/workspace-frontend-module.ts +115 -115
- package/src/browser/workspace-input-dialog.ts +60 -60
- package/src/browser/workspace-preferences.ts +58 -58
- package/src/browser/workspace-schema-updater.ts +148 -148
- package/src/browser/workspace-service.ts +772 -772
- 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 +143 -143
- 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 +48 -48
- 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/common/index.ts +18 -18
- package/src/common/test/mock-workspace-server.ts +29 -29
- package/src/common/utils.ts +69 -69
- package/src/common/workspace-protocol.ts +47 -47
- package/src/node/default-workspace-server.spec.ts +99 -99
- package/src/node/default-workspace-server.ts +242 -242
- package/src/node/index.ts +18 -18
- package/src/node/workspace-backend-module.ts +37 -37
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater';
|
|
2
|
-
import { Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
3
|
-
import { WorkspaceService } from './workspace-service';
|
|
4
|
-
export declare class WorkspaceWindowTitleUpdater extends WindowTitleUpdater {
|
|
5
|
-
protected readonly workspaceService: WorkspaceService;
|
|
6
|
-
protected updateTitleWidget(widget?: Widget): void;
|
|
7
|
-
}
|
|
1
|
+
import { WindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater';
|
|
2
|
+
import { Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
3
|
+
import { WorkspaceService } from './workspace-service';
|
|
4
|
+
export declare class WorkspaceWindowTitleUpdater extends WindowTitleUpdater {
|
|
5
|
+
protected readonly workspaceService: WorkspaceService;
|
|
6
|
+
protected updateTitleWidget(widget?: Widget): void;
|
|
7
|
+
}
|
|
8
8
|
//# sourceMappingURL=workspace-window-title-updater.d.ts.map
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 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 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.WorkspaceWindowTitleUpdater = void 0;
|
|
28
|
-
const window_title_updater_1 = require("@theia/core/lib/browser/window/window-title-updater");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const workspace_service_1 = require("./workspace-service");
|
|
31
|
-
const navigatable_1 = require("@theia/core/lib/browser/navigatable");
|
|
32
|
-
let WorkspaceWindowTitleUpdater = class WorkspaceWindowTitleUpdater extends window_title_updater_1.WindowTitleUpdater {
|
|
33
|
-
updateTitleWidget(widget) {
|
|
34
|
-
super.updateTitleWidget(widget);
|
|
35
|
-
let folderName;
|
|
36
|
-
let folderPath;
|
|
37
|
-
if (navigatable_1.Navigatable.is(widget)) {
|
|
38
|
-
const folder = this.workspaceService.getWorkspaceRootUri(widget.getResourceUri());
|
|
39
|
-
if (folder) {
|
|
40
|
-
folderName = this.labelProvider.getName(folder);
|
|
41
|
-
folderPath = folder.path.toString();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
this.windowTitleService.update({
|
|
45
|
-
folderName,
|
|
46
|
-
folderPath
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
52
|
-
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
53
|
-
], WorkspaceWindowTitleUpdater.prototype, "workspaceService", void 0);
|
|
54
|
-
WorkspaceWindowTitleUpdater = __decorate([
|
|
55
|
-
(0, inversify_1.injectable)()
|
|
56
|
-
], WorkspaceWindowTitleUpdater);
|
|
57
|
-
exports.WorkspaceWindowTitleUpdater = WorkspaceWindowTitleUpdater;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 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 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.WorkspaceWindowTitleUpdater = void 0;
|
|
28
|
+
const window_title_updater_1 = require("@theia/core/lib/browser/window/window-title-updater");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const workspace_service_1 = require("./workspace-service");
|
|
31
|
+
const navigatable_1 = require("@theia/core/lib/browser/navigatable");
|
|
32
|
+
let WorkspaceWindowTitleUpdater = class WorkspaceWindowTitleUpdater extends window_title_updater_1.WindowTitleUpdater {
|
|
33
|
+
updateTitleWidget(widget) {
|
|
34
|
+
super.updateTitleWidget(widget);
|
|
35
|
+
let folderName;
|
|
36
|
+
let folderPath;
|
|
37
|
+
if (navigatable_1.Navigatable.is(widget)) {
|
|
38
|
+
const folder = this.workspaceService.getWorkspaceRootUri(widget.getResourceUri());
|
|
39
|
+
if (folder) {
|
|
40
|
+
folderName = this.labelProvider.getName(folder);
|
|
41
|
+
folderPath = folder.path.toString();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
this.windowTitleService.update({
|
|
45
|
+
folderName,
|
|
46
|
+
folderPath
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
52
|
+
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
53
|
+
], WorkspaceWindowTitleUpdater.prototype, "workspaceService", void 0);
|
|
54
|
+
WorkspaceWindowTitleUpdater = __decorate([
|
|
55
|
+
(0, inversify_1.injectable)()
|
|
56
|
+
], WorkspaceWindowTitleUpdater);
|
|
57
|
+
exports.WorkspaceWindowTitleUpdater = WorkspaceWindowTitleUpdater;
|
|
58
58
|
//# sourceMappingURL=workspace-window-title-updater.js.map
|
package/lib/common/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './workspace-protocol';
|
|
2
|
-
export * from './utils';
|
|
1
|
+
export * from './workspace-protocol';
|
|
2
|
+
export * from './utils';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/common/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
__exportStar(require("./workspace-protocol"), exports);
|
|
29
|
-
__exportStar(require("./utils"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
__exportStar(require("./workspace-protocol"), exports);
|
|
29
|
+
__exportStar(require("./utils"), exports);
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WorkspaceServer } from '../workspace-protocol';
|
|
2
|
-
export declare class MockWorkspaceServer implements WorkspaceServer {
|
|
3
|
-
getRecentWorkspaces(): Promise<string[]>;
|
|
4
|
-
getMostRecentlyUsedWorkspace(): Promise<string | undefined>;
|
|
5
|
-
setMostRecentlyUsedWorkspace(uri: string): Promise<void>;
|
|
6
|
-
removeRecentWorkspace(uri: string): Promise<void>;
|
|
7
|
-
}
|
|
1
|
+
import { WorkspaceServer } from '../workspace-protocol';
|
|
2
|
+
export declare class MockWorkspaceServer implements WorkspaceServer {
|
|
3
|
+
getRecentWorkspaces(): Promise<string[]>;
|
|
4
|
+
getMostRecentlyUsedWorkspace(): Promise<string | undefined>;
|
|
5
|
+
setMostRecentlyUsedWorkspace(uri: string): Promise<void>;
|
|
6
|
+
removeRecentWorkspace(uri: string): Promise<void>;
|
|
7
|
+
}
|
|
8
8
|
//# sourceMappingURL=mock-workspace-server.d.ts.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MockWorkspaceServer = void 0;
|
|
10
|
-
// *****************************************************************************
|
|
11
|
-
// Copyright (C) 2017 Ericsson and others.
|
|
12
|
-
//
|
|
13
|
-
// This program and the accompanying materials are made available under the
|
|
14
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
-
//
|
|
17
|
-
// This Source Code may also be made available under the following Secondary
|
|
18
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
-
// with the GNU Classpath Exception which is available at
|
|
21
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
22
|
-
//
|
|
23
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
-
// *****************************************************************************
|
|
25
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
-
let MockWorkspaceServer = class MockWorkspaceServer {
|
|
27
|
-
getRecentWorkspaces() { return Promise.resolve([]); }
|
|
28
|
-
getMostRecentlyUsedWorkspace() { return Promise.resolve(''); }
|
|
29
|
-
setMostRecentlyUsedWorkspace(uri) { return Promise.resolve(); }
|
|
30
|
-
removeRecentWorkspace(uri) { return Promise.resolve(); }
|
|
31
|
-
};
|
|
32
|
-
MockWorkspaceServer = __decorate([
|
|
33
|
-
(0, inversify_1.injectable)()
|
|
34
|
-
], MockWorkspaceServer);
|
|
35
|
-
exports.MockWorkspaceServer = MockWorkspaceServer;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MockWorkspaceServer = void 0;
|
|
10
|
+
// *****************************************************************************
|
|
11
|
+
// Copyright (C) 2017 Ericsson and others.
|
|
12
|
+
//
|
|
13
|
+
// This program and the accompanying materials are made available under the
|
|
14
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
+
//
|
|
17
|
+
// This Source Code may also be made available under the following Secondary
|
|
18
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
+
// with the GNU Classpath Exception which is available at
|
|
21
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
22
|
+
//
|
|
23
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
+
// *****************************************************************************
|
|
25
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
+
let MockWorkspaceServer = class MockWorkspaceServer {
|
|
27
|
+
getRecentWorkspaces() { return Promise.resolve([]); }
|
|
28
|
+
getMostRecentlyUsedWorkspace() { return Promise.resolve(''); }
|
|
29
|
+
setMostRecentlyUsedWorkspace(uri) { return Promise.resolve(); }
|
|
30
|
+
removeRecentWorkspace(uri) { return Promise.resolve(); }
|
|
31
|
+
};
|
|
32
|
+
MockWorkspaceServer = __decorate([
|
|
33
|
+
(0, inversify_1.injectable)()
|
|
34
|
+
], MockWorkspaceServer);
|
|
35
|
+
exports.MockWorkspaceServer = MockWorkspaceServer;
|
|
36
36
|
//# sourceMappingURL=mock-workspace-server.js.map
|
package/lib/common/utils.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
3
|
-
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
4
|
-
import { MaybePromise } from '@theia/core';
|
|
5
|
-
export declare const THEIA_EXT = "theia-workspace";
|
|
6
|
-
export declare const VSCODE_EXT = "code-workspace";
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated since 1.4.0 - because of https://github.com/eclipse-theia/theia/tree/master/doc/coding-guidelines.md#di-function-export,
|
|
9
|
-
* use `WorkspaceService.getUntitledWorkspace` instead
|
|
10
|
-
*/
|
|
11
|
-
export declare function getTemporaryWorkspaceFileUri(envVariableServer: EnvVariablesServer): Promise<URI>;
|
|
12
|
-
export declare class CommonWorkspaceUtils {
|
|
13
|
-
/**
|
|
14
|
-
* Check if the file should be considered as a workspace file.
|
|
15
|
-
*
|
|
16
|
-
* Example: We should not try to read the contents of an .exe file.
|
|
17
|
-
*/
|
|
18
|
-
isWorkspaceFile(candidate: FileStat | URI): boolean;
|
|
19
|
-
isUntitledWorkspace(candidate?: URI): boolean;
|
|
20
|
-
getUntitledWorkspaceUri(configDirUri: URI, isAcceptable: (candidate: URI) => MaybePromise<boolean>, warnOnHits?: () => unknown): Promise<URI>;
|
|
21
|
-
}
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
3
|
+
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
4
|
+
import { MaybePromise } from '@theia/core';
|
|
5
|
+
export declare const THEIA_EXT = "theia-workspace";
|
|
6
|
+
export declare const VSCODE_EXT = "code-workspace";
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated since 1.4.0 - because of https://github.com/eclipse-theia/theia/tree/master/doc/coding-guidelines.md#di-function-export,
|
|
9
|
+
* use `WorkspaceService.getUntitledWorkspace` instead
|
|
10
|
+
*/
|
|
11
|
+
export declare function getTemporaryWorkspaceFileUri(envVariableServer: EnvVariablesServer): Promise<URI>;
|
|
12
|
+
export declare class CommonWorkspaceUtils {
|
|
13
|
+
/**
|
|
14
|
+
* Check if the file should be considered as a workspace file.
|
|
15
|
+
*
|
|
16
|
+
* Example: We should not try to read the contents of an .exe file.
|
|
17
|
+
*/
|
|
18
|
+
isWorkspaceFile(candidate: FileStat | URI): boolean;
|
|
19
|
+
isUntitledWorkspace(candidate?: URI): boolean;
|
|
20
|
+
getUntitledWorkspaceUri(configDirUri: URI, isAcceptable: (candidate: URI) => MaybePromise<boolean>, warnOnHits?: () => unknown): Promise<URI>;
|
|
21
|
+
}
|
|
22
22
|
//# sourceMappingURL=utils.d.ts.map
|
package/lib/common/utils.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
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 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.CommonWorkspaceUtils = exports.getTemporaryWorkspaceFileUri = exports.VSCODE_EXT = exports.THEIA_EXT = void 0;
|
|
25
|
-
// TODO get rid of util files, replace with methods in a responsible class
|
|
26
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
27
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
28
|
-
const files_1 = require("@theia/filesystem/lib/common/files");
|
|
29
|
-
exports.THEIA_EXT = 'theia-workspace';
|
|
30
|
-
exports.VSCODE_EXT = 'code-workspace';
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated since 1.4.0 - because of https://github.com/eclipse-theia/theia/tree/master/doc/coding-guidelines.md#di-function-export,
|
|
33
|
-
* use `WorkspaceService.getUntitledWorkspace` instead
|
|
34
|
-
*/
|
|
35
|
-
async function getTemporaryWorkspaceFileUri(envVariableServer) {
|
|
36
|
-
const configDirUri = await envVariableServer.getConfigDirUri();
|
|
37
|
-
return new uri_1.default(configDirUri).resolve(`Untitled.${exports.THEIA_EXT}`);
|
|
38
|
-
}
|
|
39
|
-
exports.getTemporaryWorkspaceFileUri = getTemporaryWorkspaceFileUri;
|
|
40
|
-
let CommonWorkspaceUtils = class CommonWorkspaceUtils {
|
|
41
|
-
/**
|
|
42
|
-
* Check if the file should be considered as a workspace file.
|
|
43
|
-
*
|
|
44
|
-
* Example: We should not try to read the contents of an .exe file.
|
|
45
|
-
*/
|
|
46
|
-
isWorkspaceFile(candidate) {
|
|
47
|
-
const uri = files_1.FileStat.is(candidate) ? candidate.resource : candidate;
|
|
48
|
-
return uri.path.ext === `.${exports.THEIA_EXT}` || uri.path.ext === `.${exports.VSCODE_EXT}`;
|
|
49
|
-
}
|
|
50
|
-
isUntitledWorkspace(candidate) {
|
|
51
|
-
return !!candidate && this.isWorkspaceFile(candidate) && candidate.path.base.startsWith('Untitled');
|
|
52
|
-
}
|
|
53
|
-
async getUntitledWorkspaceUri(configDirUri, isAcceptable, warnOnHits) {
|
|
54
|
-
const parentDir = configDirUri.resolve('workspaces');
|
|
55
|
-
let uri;
|
|
56
|
-
let attempts = 0;
|
|
57
|
-
do {
|
|
58
|
-
attempts++;
|
|
59
|
-
uri = parentDir.resolve(`Untitled-${Math.round(Math.random() * 1000)}.${exports.THEIA_EXT}`);
|
|
60
|
-
if (attempts === 10) {
|
|
61
|
-
warnOnHits === null || warnOnHits === void 0 ? void 0 : warnOnHits();
|
|
62
|
-
}
|
|
63
|
-
if (attempts === 50) {
|
|
64
|
-
throw new Error('Workspace Service: too many attempts to find unused filename.');
|
|
65
|
-
}
|
|
66
|
-
} while (!(await isAcceptable(uri)));
|
|
67
|
-
return uri;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
CommonWorkspaceUtils = __decorate([
|
|
71
|
-
(0, inversify_1.injectable)()
|
|
72
|
-
], CommonWorkspaceUtils);
|
|
73
|
-
exports.CommonWorkspaceUtils = CommonWorkspaceUtils;
|
|
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 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.CommonWorkspaceUtils = exports.getTemporaryWorkspaceFileUri = exports.VSCODE_EXT = exports.THEIA_EXT = void 0;
|
|
25
|
+
// TODO get rid of util files, replace with methods in a responsible class
|
|
26
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
27
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
28
|
+
const files_1 = require("@theia/filesystem/lib/common/files");
|
|
29
|
+
exports.THEIA_EXT = 'theia-workspace';
|
|
30
|
+
exports.VSCODE_EXT = 'code-workspace';
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated since 1.4.0 - because of https://github.com/eclipse-theia/theia/tree/master/doc/coding-guidelines.md#di-function-export,
|
|
33
|
+
* use `WorkspaceService.getUntitledWorkspace` instead
|
|
34
|
+
*/
|
|
35
|
+
async function getTemporaryWorkspaceFileUri(envVariableServer) {
|
|
36
|
+
const configDirUri = await envVariableServer.getConfigDirUri();
|
|
37
|
+
return new uri_1.default(configDirUri).resolve(`Untitled.${exports.THEIA_EXT}`);
|
|
38
|
+
}
|
|
39
|
+
exports.getTemporaryWorkspaceFileUri = getTemporaryWorkspaceFileUri;
|
|
40
|
+
let CommonWorkspaceUtils = class CommonWorkspaceUtils {
|
|
41
|
+
/**
|
|
42
|
+
* Check if the file should be considered as a workspace file.
|
|
43
|
+
*
|
|
44
|
+
* Example: We should not try to read the contents of an .exe file.
|
|
45
|
+
*/
|
|
46
|
+
isWorkspaceFile(candidate) {
|
|
47
|
+
const uri = files_1.FileStat.is(candidate) ? candidate.resource : candidate;
|
|
48
|
+
return uri.path.ext === `.${exports.THEIA_EXT}` || uri.path.ext === `.${exports.VSCODE_EXT}`;
|
|
49
|
+
}
|
|
50
|
+
isUntitledWorkspace(candidate) {
|
|
51
|
+
return !!candidate && this.isWorkspaceFile(candidate) && candidate.path.base.startsWith('Untitled');
|
|
52
|
+
}
|
|
53
|
+
async getUntitledWorkspaceUri(configDirUri, isAcceptable, warnOnHits) {
|
|
54
|
+
const parentDir = configDirUri.resolve('workspaces');
|
|
55
|
+
let uri;
|
|
56
|
+
let attempts = 0;
|
|
57
|
+
do {
|
|
58
|
+
attempts++;
|
|
59
|
+
uri = parentDir.resolve(`Untitled-${Math.round(Math.random() * 1000)}.${exports.THEIA_EXT}`);
|
|
60
|
+
if (attempts === 10) {
|
|
61
|
+
warnOnHits === null || warnOnHits === void 0 ? void 0 : warnOnHits();
|
|
62
|
+
}
|
|
63
|
+
if (attempts === 50) {
|
|
64
|
+
throw new Error('Workspace Service: too many attempts to find unused filename.');
|
|
65
|
+
}
|
|
66
|
+
} while (!(await isAcceptable(uri)));
|
|
67
|
+
return uri;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
CommonWorkspaceUtils = __decorate([
|
|
71
|
+
(0, inversify_1.injectable)()
|
|
72
|
+
], CommonWorkspaceUtils);
|
|
73
|
+
exports.CommonWorkspaceUtils = CommonWorkspaceUtils;
|
|
74
74
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export declare const workspacePath = "/services/workspace";
|
|
2
|
-
/**
|
|
3
|
-
* The JSON-RPC workspace interface.
|
|
4
|
-
*/
|
|
5
|
-
export declare const WorkspaceServer: unique symbol;
|
|
6
|
-
export interface WorkspaceServer {
|
|
7
|
-
/**
|
|
8
|
-
* Returns with a promise that resolves to the most recently used workspace folder URI as a string.
|
|
9
|
-
* Resolves to `undefined` if the workspace folder is not yet set.
|
|
10
|
-
*/
|
|
11
|
-
getMostRecentlyUsedWorkspace(): Promise<string | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Sets the desired string representation of the URI as the most recently used workspace folder.
|
|
14
|
-
*/
|
|
15
|
-
setMostRecentlyUsedWorkspace(uri: string): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Removes a workspace from the list of recently opened workspaces.
|
|
18
|
-
*
|
|
19
|
-
* @param uri the workspace uri.
|
|
20
|
-
*/
|
|
21
|
-
removeRecentWorkspace(uri: string): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Returns list of recently opened workspaces as an array.
|
|
24
|
-
*/
|
|
25
|
-
getRecentWorkspaces(): Promise<string[]>;
|
|
26
|
-
}
|
|
1
|
+
export declare const workspacePath = "/services/workspace";
|
|
2
|
+
/**
|
|
3
|
+
* The JSON-RPC workspace interface.
|
|
4
|
+
*/
|
|
5
|
+
export declare const WorkspaceServer: unique symbol;
|
|
6
|
+
export interface WorkspaceServer {
|
|
7
|
+
/**
|
|
8
|
+
* Returns with a promise that resolves to the most recently used workspace folder URI as a string.
|
|
9
|
+
* Resolves to `undefined` if the workspace folder is not yet set.
|
|
10
|
+
*/
|
|
11
|
+
getMostRecentlyUsedWorkspace(): Promise<string | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the desired string representation of the URI as the most recently used workspace folder.
|
|
14
|
+
*/
|
|
15
|
+
setMostRecentlyUsedWorkspace(uri: string): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Removes a workspace from the list of recently opened workspaces.
|
|
18
|
+
*
|
|
19
|
+
* @param uri the workspace uri.
|
|
20
|
+
*/
|
|
21
|
+
removeRecentWorkspace(uri: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns list of recently opened workspaces as an array.
|
|
24
|
+
*/
|
|
25
|
+
getRecentWorkspaces(): Promise<string[]>;
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=workspace-protocol.d.ts.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.WorkspaceServer = exports.workspacePath = void 0;
|
|
19
|
-
exports.workspacePath = '/services/workspace';
|
|
20
|
-
/**
|
|
21
|
-
* The JSON-RPC workspace interface.
|
|
22
|
-
*/
|
|
23
|
-
exports.WorkspaceServer = Symbol('WorkspaceServer');
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.WorkspaceServer = exports.workspacePath = void 0;
|
|
19
|
+
exports.workspacePath = '/services/workspace';
|
|
20
|
+
/**
|
|
21
|
+
* The JSON-RPC workspace interface.
|
|
22
|
+
*/
|
|
23
|
+
exports.WorkspaceServer = Symbol('WorkspaceServer');
|
|
24
24
|
//# sourceMappingURL=workspace-protocol.js.map
|