@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,86 +1,86 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Alexander Flammer 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const mock_env_variables_server_1 = require("@theia/core/lib/browser/test/mock-env-variables-server");
|
|
20
|
-
const env_variables_1 = require("@theia/core/lib/common/env-variables");
|
|
21
|
-
const node_1 = require("@theia/core/lib/node");
|
|
22
|
-
const common_1 = require("../common");
|
|
23
|
-
const default_workspace_server_1 = require("./default-workspace-server");
|
|
24
|
-
const chai_1 = require("chai");
|
|
25
|
-
const temp = require("temp");
|
|
26
|
-
const fs = require("fs");
|
|
27
|
-
describe('DefaultWorkspaceServer', function () {
|
|
28
|
-
describe('getRecentWorkspaces()', async () => {
|
|
29
|
-
let workspaceServer;
|
|
30
|
-
let tmpConfigDir;
|
|
31
|
-
let recentWorkspaceFile;
|
|
32
|
-
beforeEach(() => {
|
|
33
|
-
// create a temporary directory
|
|
34
|
-
const tempDirPath = temp.track().mkdirSync();
|
|
35
|
-
tmpConfigDir = node_1.FileUri.create(fs.realpathSync(tempDirPath));
|
|
36
|
-
recentWorkspaceFile = node_1.FileUri.fsPath(tmpConfigDir.resolve('recentworkspace.json'));
|
|
37
|
-
// create a container with the necessary bindings for the DefaultWorkspaceServer
|
|
38
|
-
const container = new inversify_1.Container();
|
|
39
|
-
container.bind(default_workspace_server_1.WorkspaceCliContribution).toSelf().inSingletonScope();
|
|
40
|
-
container.bind(default_workspace_server_1.DefaultWorkspaceServer).toSelf().inSingletonScope();
|
|
41
|
-
container.bind(common_1.WorkspaceFileService).toSelf().inSingletonScope();
|
|
42
|
-
container.bind(common_1.UntitledWorkspaceService).toSelf().inSingletonScope();
|
|
43
|
-
container.bind(env_variables_1.EnvVariablesServer).toConstantValue(new mock_env_variables_server_1.MockEnvVariablesServerImpl(tmpConfigDir));
|
|
44
|
-
workspaceServer = container.get(default_workspace_server_1.DefaultWorkspaceServer);
|
|
45
|
-
});
|
|
46
|
-
it('should return empty list of workspaces if no recent workspaces file is existing', async function () {
|
|
47
|
-
const recent = await workspaceServer.getRecentWorkspaces();
|
|
48
|
-
(0, chai_1.expect)(recent).to.be.empty;
|
|
49
|
-
});
|
|
50
|
-
it('should not return non-existing workspaces from recent workspaces file', async function () {
|
|
51
|
-
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
52
|
-
recentRoots: [
|
|
53
|
-
tmpConfigDir.resolve('somethingNotExisting').toString(),
|
|
54
|
-
tmpConfigDir.resolve('somethingElseNotExisting').toString()
|
|
55
|
-
]
|
|
56
|
-
}));
|
|
57
|
-
const recent = await workspaceServer.getRecentWorkspaces();
|
|
58
|
-
(0, chai_1.expect)(recent).to.be.empty;
|
|
59
|
-
});
|
|
60
|
-
it('should return only existing workspaces from recent workspaces file', async function () {
|
|
61
|
-
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
62
|
-
recentRoots: [
|
|
63
|
-
tmpConfigDir.toString(),
|
|
64
|
-
tmpConfigDir.resolve('somethingNotExisting').toString()
|
|
65
|
-
]
|
|
66
|
-
}));
|
|
67
|
-
const recent = await workspaceServer.getRecentWorkspaces();
|
|
68
|
-
(0, chai_1.expect)(recent).to.have.members([tmpConfigDir.toString()]);
|
|
69
|
-
});
|
|
70
|
-
it('should ignore non-string array entries but return remaining existing file paths', async function () {
|
|
71
|
-
// previously caused: 'TypeError: Cannot read property 'fsPath' of undefined', see issue #10250
|
|
72
|
-
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
73
|
-
recentRoots: [
|
|
74
|
-
[tmpConfigDir.toString()],
|
|
75
|
-
{},
|
|
76
|
-
12345678,
|
|
77
|
-
undefined,
|
|
78
|
-
tmpConfigDir.toString(),
|
|
79
|
-
]
|
|
80
|
-
}));
|
|
81
|
-
const recent = await workspaceServer.getRecentWorkspaces();
|
|
82
|
-
(0, chai_1.expect)(recent).to.have.members([tmpConfigDir.toString()]);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Alexander Flammer 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const mock_env_variables_server_1 = require("@theia/core/lib/browser/test/mock-env-variables-server");
|
|
20
|
+
const env_variables_1 = require("@theia/core/lib/common/env-variables");
|
|
21
|
+
const node_1 = require("@theia/core/lib/node");
|
|
22
|
+
const common_1 = require("../common");
|
|
23
|
+
const default_workspace_server_1 = require("./default-workspace-server");
|
|
24
|
+
const chai_1 = require("chai");
|
|
25
|
+
const temp = require("temp");
|
|
26
|
+
const fs = require("fs");
|
|
27
|
+
describe('DefaultWorkspaceServer', function () {
|
|
28
|
+
describe('getRecentWorkspaces()', async () => {
|
|
29
|
+
let workspaceServer;
|
|
30
|
+
let tmpConfigDir;
|
|
31
|
+
let recentWorkspaceFile;
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
// create a temporary directory
|
|
34
|
+
const tempDirPath = temp.track().mkdirSync();
|
|
35
|
+
tmpConfigDir = node_1.FileUri.create(fs.realpathSync(tempDirPath));
|
|
36
|
+
recentWorkspaceFile = node_1.FileUri.fsPath(tmpConfigDir.resolve('recentworkspace.json'));
|
|
37
|
+
// create a container with the necessary bindings for the DefaultWorkspaceServer
|
|
38
|
+
const container = new inversify_1.Container();
|
|
39
|
+
container.bind(default_workspace_server_1.WorkspaceCliContribution).toSelf().inSingletonScope();
|
|
40
|
+
container.bind(default_workspace_server_1.DefaultWorkspaceServer).toSelf().inSingletonScope();
|
|
41
|
+
container.bind(common_1.WorkspaceFileService).toSelf().inSingletonScope();
|
|
42
|
+
container.bind(common_1.UntitledWorkspaceService).toSelf().inSingletonScope();
|
|
43
|
+
container.bind(env_variables_1.EnvVariablesServer).toConstantValue(new mock_env_variables_server_1.MockEnvVariablesServerImpl(tmpConfigDir));
|
|
44
|
+
workspaceServer = container.get(default_workspace_server_1.DefaultWorkspaceServer);
|
|
45
|
+
});
|
|
46
|
+
it('should return empty list of workspaces if no recent workspaces file is existing', async function () {
|
|
47
|
+
const recent = await workspaceServer.getRecentWorkspaces();
|
|
48
|
+
(0, chai_1.expect)(recent).to.be.empty;
|
|
49
|
+
});
|
|
50
|
+
it('should not return non-existing workspaces from recent workspaces file', async function () {
|
|
51
|
+
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
52
|
+
recentRoots: [
|
|
53
|
+
tmpConfigDir.resolve('somethingNotExisting').toString(),
|
|
54
|
+
tmpConfigDir.resolve('somethingElseNotExisting').toString()
|
|
55
|
+
]
|
|
56
|
+
}));
|
|
57
|
+
const recent = await workspaceServer.getRecentWorkspaces();
|
|
58
|
+
(0, chai_1.expect)(recent).to.be.empty;
|
|
59
|
+
});
|
|
60
|
+
it('should return only existing workspaces from recent workspaces file', async function () {
|
|
61
|
+
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
62
|
+
recentRoots: [
|
|
63
|
+
tmpConfigDir.toString(),
|
|
64
|
+
tmpConfigDir.resolve('somethingNotExisting').toString()
|
|
65
|
+
]
|
|
66
|
+
}));
|
|
67
|
+
const recent = await workspaceServer.getRecentWorkspaces();
|
|
68
|
+
(0, chai_1.expect)(recent).to.have.members([tmpConfigDir.toString()]);
|
|
69
|
+
});
|
|
70
|
+
it('should ignore non-string array entries but return remaining existing file paths', async function () {
|
|
71
|
+
// previously caused: 'TypeError: Cannot read property 'fsPath' of undefined', see issue #10250
|
|
72
|
+
fs.writeFileSync(recentWorkspaceFile, JSON.stringify({
|
|
73
|
+
recentRoots: [
|
|
74
|
+
[tmpConfigDir.toString()],
|
|
75
|
+
{},
|
|
76
|
+
12345678,
|
|
77
|
+
undefined,
|
|
78
|
+
tmpConfigDir.toString(),
|
|
79
|
+
]
|
|
80
|
+
}));
|
|
81
|
+
const recent = await workspaceServer.getRecentWorkspaces();
|
|
82
|
+
(0, chai_1.expect)(recent).to.have.members([tmpConfigDir.toString()]);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
86
|
//# sourceMappingURL=default-workspace-server.spec.js.map
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './default-workspace-server';
|
|
2
|
-
export * from './workspace-backend-module';
|
|
1
|
+
export * from './default-workspace-server';
|
|
2
|
+
export * from './workspace-backend-module';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/node/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-only 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("./default-workspace-server"), exports);
|
|
29
|
-
__exportStar(require("./workspace-backend-module"), 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-only 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("./default-workspace-server"), exports);
|
|
29
|
+
__exportStar(require("./workspace-backend-module"), exports);
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
-
declare const _default: ContainerModule;
|
|
3
|
-
export default _default;
|
|
1
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
+
declare const _default: ContainerModule;
|
|
3
|
+
export default _default;
|
|
4
4
|
//# sourceMappingURL=workspace-backend-module.d.ts.map
|
|
@@ -1,34 +1,34 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const common_1 = require("@theia/core/lib/common");
|
|
20
|
-
const common_2 = require("../common");
|
|
21
|
-
const default_workspace_server_1 = require("./default-workspace-server");
|
|
22
|
-
const cli_1 = require("@theia/core/lib/node/cli");
|
|
23
|
-
const node_1 = require("@theia/core/lib/node");
|
|
24
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
25
|
-
bind(default_workspace_server_1.WorkspaceCliContribution).toSelf().inSingletonScope();
|
|
26
|
-
bind(cli_1.CliContribution).toService(default_workspace_server_1.WorkspaceCliContribution);
|
|
27
|
-
bind(default_workspace_server_1.DefaultWorkspaceServer).toSelf().inSingletonScope();
|
|
28
|
-
bind(common_2.WorkspaceServer).toService(default_workspace_server_1.DefaultWorkspaceServer);
|
|
29
|
-
bind(node_1.BackendApplicationContribution).toService(common_2.WorkspaceServer);
|
|
30
|
-
bind(common_2.UntitledWorkspaceService).toSelf().inSingletonScope();
|
|
31
|
-
bind(common_2.WorkspaceFileService).toSelf().inSingletonScope();
|
|
32
|
-
bind(common_1.ConnectionHandler).toDynamicValue(ctx => new common_1.RpcConnectionHandler(common_2.workspacePath, () => ctx.container.get(common_2.WorkspaceServer))).inSingletonScope();
|
|
33
|
-
});
|
|
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-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const common_1 = require("@theia/core/lib/common");
|
|
20
|
+
const common_2 = require("../common");
|
|
21
|
+
const default_workspace_server_1 = require("./default-workspace-server");
|
|
22
|
+
const cli_1 = require("@theia/core/lib/node/cli");
|
|
23
|
+
const node_1 = require("@theia/core/lib/node");
|
|
24
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
25
|
+
bind(default_workspace_server_1.WorkspaceCliContribution).toSelf().inSingletonScope();
|
|
26
|
+
bind(cli_1.CliContribution).toService(default_workspace_server_1.WorkspaceCliContribution);
|
|
27
|
+
bind(default_workspace_server_1.DefaultWorkspaceServer).toSelf().inSingletonScope();
|
|
28
|
+
bind(common_2.WorkspaceServer).toService(default_workspace_server_1.DefaultWorkspaceServer);
|
|
29
|
+
bind(node_1.BackendApplicationContribution).toService(common_2.WorkspaceServer);
|
|
30
|
+
bind(common_2.UntitledWorkspaceService).toSelf().inSingletonScope();
|
|
31
|
+
bind(common_2.WorkspaceFileService).toSelf().inSingletonScope();
|
|
32
|
+
bind(common_1.ConnectionHandler).toDynamicValue(ctx => new common_1.RpcConnectionHandler(common_2.workspacePath, () => ctx.container.get(common_2.WorkspaceServer))).inSingletonScope();
|
|
33
|
+
});
|
|
34
34
|
//# sourceMappingURL=workspace-backend-module.js.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/workspace",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.0-next.72+4a275b29d",
|
|
4
4
|
"description": "Theia - Workspace Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/filesystem": "1.
|
|
8
|
-
"@theia/variable-resolver": "1.
|
|
6
|
+
"@theia/core": "1.46.0-next.72+4a275b29d",
|
|
7
|
+
"@theia/filesystem": "1.46.0-next.72+4a275b29d",
|
|
8
|
+
"@theia/variable-resolver": "1.46.0-next.72+4a275b29d",
|
|
9
9
|
"jsonc-parser": "^2.2.0",
|
|
10
10
|
"valid-filename": "^2.0.1"
|
|
11
11
|
},
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
{
|
|
17
17
|
"frontend": "lib/browser/workspace-frontend-module",
|
|
18
18
|
"backend": "lib/node/workspace-backend-module"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"frontendOnly": "lib/browser-only/workspace-frontend-only-module"
|
|
19
22
|
}
|
|
20
23
|
],
|
|
21
24
|
"keywords": [
|
|
@@ -43,10 +46,10 @@
|
|
|
43
46
|
"watch": "theiaext watch"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
|
-
"@theia/ext-scripts": "1.
|
|
49
|
+
"@theia/ext-scripts": "1.46.0"
|
|
47
50
|
},
|
|
48
51
|
"nyc": {
|
|
49
52
|
"extends": "../../configs/nyc.json"
|
|
50
53
|
},
|
|
51
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4a275b29d0db6c81190488c7f76cb667da05ef19"
|
|
52
55
|
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 STMicroelectronics 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 { CancellationToken, URI } from '@theia/core/lib/common';
|
|
18
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { Disposable } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
20
|
-
|
|
21
|
-
export interface CanonicalUriProvider extends Disposable {
|
|
22
|
-
provideCanonicalUri(uri: URI, targetScheme: string, token: CancellationToken): Promise<URI | undefined>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@injectable()
|
|
26
|
-
export class CanonicalUriService {
|
|
27
|
-
private providers = new Map<string, CanonicalUriProvider>();
|
|
28
|
-
|
|
29
|
-
registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable {
|
|
30
|
-
if (this.providers.has(scheme)) {
|
|
31
|
-
throw new Error(`Canonical URI provider for scheme: '${scheme}' already exists`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.providers.set(scheme, provider);
|
|
35
|
-
return Disposable.create(() => { this.removeCanonicalUriProvider(scheme); });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private removeCanonicalUriProvider(scheme: string): void {
|
|
39
|
-
const provider = this.providers.get(scheme);
|
|
40
|
-
if (!provider) {
|
|
41
|
-
throw new Error(`No Canonical URI provider for scheme: '${scheme}' exists`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
this.providers.delete(scheme);
|
|
45
|
-
provider.dispose();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async provideCanonicalUri(uri: URI, targetScheme: string, token: CancellationToken = CancellationToken.None): Promise<URI | undefined> {
|
|
49
|
-
const provider = this.providers.get(uri.scheme);
|
|
50
|
-
if (!provider) {
|
|
51
|
-
console.warn(`No Canonical URI provider for scheme: '${uri.scheme}' exists`);
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return provider.provideCanonicalUri(uri, targetScheme, token);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 STMicroelectronics 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 { CancellationToken, URI } from '@theia/core/lib/common';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { Disposable } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
20
|
+
|
|
21
|
+
export interface CanonicalUriProvider extends Disposable {
|
|
22
|
+
provideCanonicalUri(uri: URI, targetScheme: string, token: CancellationToken): Promise<URI | undefined>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@injectable()
|
|
26
|
+
export class CanonicalUriService {
|
|
27
|
+
private providers = new Map<string, CanonicalUriProvider>();
|
|
28
|
+
|
|
29
|
+
registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable {
|
|
30
|
+
if (this.providers.has(scheme)) {
|
|
31
|
+
throw new Error(`Canonical URI provider for scheme: '${scheme}' already exists`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.providers.set(scheme, provider);
|
|
35
|
+
return Disposable.create(() => { this.removeCanonicalUriProvider(scheme); });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private removeCanonicalUriProvider(scheme: string): void {
|
|
39
|
+
const provider = this.providers.get(scheme);
|
|
40
|
+
if (!provider) {
|
|
41
|
+
throw new Error(`No Canonical URI provider for scheme: '${scheme}' exists`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.providers.delete(scheme);
|
|
45
|
+
provider.dispose();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async provideCanonicalUri(uri: URI, targetScheme: string, token: CancellationToken = CancellationToken.None): Promise<URI | undefined> {
|
|
49
|
+
const provider = this.providers.get(uri.scheme);
|
|
50
|
+
if (!provider) {
|
|
51
|
+
console.warn(`No Canonical URI provider for scheme: '${uri.scheme}' exists`);
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return provider.provideCanonicalUri(uri, targetScheme, token);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 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 { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import URI from '@theia/core/lib/common/uri';
|
|
19
|
-
import { DiffUris } from '@theia/core/lib/browser/diff-uris';
|
|
20
|
-
import { open, OpenerService, OpenerOptions } from '@theia/core/lib/browser';
|
|
21
|
-
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
22
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
23
|
-
|
|
24
|
-
@injectable()
|
|
25
|
-
export class DiffService {
|
|
26
|
-
|
|
27
|
-
@inject(FileService) protected readonly fileService: FileService;
|
|
28
|
-
@inject(OpenerService) protected readonly openerService: OpenerService;
|
|
29
|
-
@inject(MessageService) protected readonly messageService: MessageService;
|
|
30
|
-
|
|
31
|
-
public async openDiffEditor(left: URI, right: URI, label?: string, options?: OpenerOptions): Promise<void> {
|
|
32
|
-
if (left.scheme === 'file' && right.scheme === 'file') {
|
|
33
|
-
const [resolvedLeft, resolvedRight] = await this.fileService.resolveAll([{ resource: left }, { resource: right }]);
|
|
34
|
-
if (resolvedLeft.success && resolvedRight.success) {
|
|
35
|
-
const leftStat = resolvedLeft.stat;
|
|
36
|
-
const rightStat = resolvedRight.stat;
|
|
37
|
-
if (leftStat && rightStat) {
|
|
38
|
-
if (!leftStat.isDirectory && !rightStat.isDirectory) {
|
|
39
|
-
const uri = DiffUris.encode(left, right, label);
|
|
40
|
-
await open(this.openerService, uri, options);
|
|
41
|
-
} else {
|
|
42
|
-
const details = (() => {
|
|
43
|
-
if (leftStat.isDirectory && rightStat.isDirectory) {
|
|
44
|
-
return 'Both resource were a directory.';
|
|
45
|
-
} else {
|
|
46
|
-
if (leftStat.isDirectory) {
|
|
47
|
-
return `'${left.path.base}' was a directory.`;
|
|
48
|
-
} else {
|
|
49
|
-
return `'${right.path.base}' was a directory.`;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
this.messageService.warn(`Directories cannot be compared. ${details()}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
const uri = DiffUris.encode(left, right, label);
|
|
59
|
-
await open(this.openerService, uri, options);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 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 { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import URI from '@theia/core/lib/common/uri';
|
|
19
|
+
import { DiffUris } from '@theia/core/lib/browser/diff-uris';
|
|
20
|
+
import { open, OpenerService, OpenerOptions } from '@theia/core/lib/browser';
|
|
21
|
+
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
22
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
23
|
+
|
|
24
|
+
@injectable()
|
|
25
|
+
export class DiffService {
|
|
26
|
+
|
|
27
|
+
@inject(FileService) protected readonly fileService: FileService;
|
|
28
|
+
@inject(OpenerService) protected readonly openerService: OpenerService;
|
|
29
|
+
@inject(MessageService) protected readonly messageService: MessageService;
|
|
30
|
+
|
|
31
|
+
public async openDiffEditor(left: URI, right: URI, label?: string, options?: OpenerOptions): Promise<void> {
|
|
32
|
+
if (left.scheme === 'file' && right.scheme === 'file') {
|
|
33
|
+
const [resolvedLeft, resolvedRight] = await this.fileService.resolveAll([{ resource: left }, { resource: right }]);
|
|
34
|
+
if (resolvedLeft.success && resolvedRight.success) {
|
|
35
|
+
const leftStat = resolvedLeft.stat;
|
|
36
|
+
const rightStat = resolvedRight.stat;
|
|
37
|
+
if (leftStat && rightStat) {
|
|
38
|
+
if (!leftStat.isDirectory && !rightStat.isDirectory) {
|
|
39
|
+
const uri = DiffUris.encode(left, right, label);
|
|
40
|
+
await open(this.openerService, uri, options);
|
|
41
|
+
} else {
|
|
42
|
+
const details = (() => {
|
|
43
|
+
if (leftStat.isDirectory && rightStat.isDirectory) {
|
|
44
|
+
return 'Both resource were a directory.';
|
|
45
|
+
} else {
|
|
46
|
+
if (leftStat.isDirectory) {
|
|
47
|
+
return `'${left.path.base}' was a directory.`;
|
|
48
|
+
} else {
|
|
49
|
+
return `'${right.path.base}' was a directory.`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
this.messageService.warn(`Directories cannot be compared. ${details()}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
const uri = DiffUris.encode(left, right, label);
|
|
59
|
+
await open(this.openerService, uri, options);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|