@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,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=workspace-commands.spec.d.ts.map
|
|
@@ -1,128 +1,128 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
-
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
20
|
-
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
21
|
-
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
22
|
-
const chai_1 = require("chai");
|
|
23
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
-
const browser_1 = require("@theia/filesystem/lib/browser");
|
|
26
|
-
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
27
|
-
const browser_2 = require("@theia/core/lib/browser");
|
|
28
|
-
const common_1 = require("@theia/core/lib/common");
|
|
29
|
-
const selection_service_1 = require("@theia/core/lib/common/selection-service");
|
|
30
|
-
const workspace_commands_1 = require("./workspace-commands");
|
|
31
|
-
const workspace_compare_handler_1 = require("./workspace-compare-handler");
|
|
32
|
-
const workspace_delete_handler_1 = require("./workspace-delete-handler");
|
|
33
|
-
const workspace_duplicate_handler_1 = require("./workspace-duplicate-handler");
|
|
34
|
-
const workspace_preferences_1 = require("./workspace-preferences");
|
|
35
|
-
const workspace_service_1 = require("./workspace-service");
|
|
36
|
-
const application_protocol_1 = require("@theia/core/lib/common/application-protocol");
|
|
37
|
-
const clipboard_service_1 = require("@theia/core/lib/browser/clipboard-service");
|
|
38
|
-
disableJSDOM();
|
|
39
|
-
describe('workspace-commands', () => {
|
|
40
|
-
let commands;
|
|
41
|
-
const childStat = {
|
|
42
|
-
isFile: true,
|
|
43
|
-
isDirectory: false,
|
|
44
|
-
isSymbolicLink: false,
|
|
45
|
-
isReadonly: false,
|
|
46
|
-
resource: new uri_1.default('foo/bar'),
|
|
47
|
-
name: 'bar',
|
|
48
|
-
};
|
|
49
|
-
const parent = {
|
|
50
|
-
isFile: false,
|
|
51
|
-
isDirectory: true,
|
|
52
|
-
isSymbolicLink: false,
|
|
53
|
-
isReadonly: false,
|
|
54
|
-
resource: new uri_1.default('foo'),
|
|
55
|
-
name: 'foo',
|
|
56
|
-
children: [
|
|
57
|
-
childStat
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
before(() => disableJSDOM = (0, jsdom_1.enableJSDOM)());
|
|
61
|
-
after(() => disableJSDOM());
|
|
62
|
-
beforeEach(() => {
|
|
63
|
-
const container = new inversify_1.Container();
|
|
64
|
-
container.bind(browser_1.FileDialogService).toConstantValue({});
|
|
65
|
-
container.bind(file_service_1.FileService).toConstantValue({
|
|
66
|
-
async exists(resource) {
|
|
67
|
-
return resource.path.base.includes('bar'); // 'bar' exists for test purposes.
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
container.bind(browser_2.FrontendApplication).toConstantValue({});
|
|
71
|
-
container.bind(browser_2.LabelProvider).toConstantValue({});
|
|
72
|
-
container.bind(common_1.MessageService).toConstantValue({});
|
|
73
|
-
container.bind(browser_2.OpenerService).toConstantValue({});
|
|
74
|
-
container.bind(selection_service_1.SelectionService).toConstantValue({});
|
|
75
|
-
container.bind(workspace_commands_1.WorkspaceCommandContribution).toSelf().inSingletonScope();
|
|
76
|
-
container.bind(workspace_compare_handler_1.WorkspaceCompareHandler).toConstantValue({});
|
|
77
|
-
container.bind(workspace_delete_handler_1.WorkspaceDeleteHandler).toConstantValue({});
|
|
78
|
-
container.bind(workspace_duplicate_handler_1.WorkspaceDuplicateHandler).toConstantValue({});
|
|
79
|
-
container.bind(workspace_preferences_1.WorkspacePreferences).toConstantValue({});
|
|
80
|
-
container.bind(workspace_service_1.WorkspaceService).toConstantValue({});
|
|
81
|
-
container.bind(clipboard_service_1.ClipboardService).toConstantValue({});
|
|
82
|
-
container.bind(application_protocol_1.ApplicationServer).toConstantValue({
|
|
83
|
-
getBackendOS() {
|
|
84
|
-
return Promise.resolve(common_1.OS.type());
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
commands = container.get(workspace_commands_1.WorkspaceCommandContribution);
|
|
88
|
-
});
|
|
89
|
-
describe('#validateFileName', () => {
|
|
90
|
-
it('should not validate an empty file name', async () => {
|
|
91
|
-
const message = await commands['validateFileName']('', parent);
|
|
92
|
-
(0, chai_1.expect)(message).to.equal('');
|
|
93
|
-
});
|
|
94
|
-
it('should accept the resource does not exist', async () => {
|
|
95
|
-
const message = await commands['validateFileName']('a.ts', parent);
|
|
96
|
-
(0, chai_1.expect)(message).to.equal('');
|
|
97
|
-
});
|
|
98
|
-
it('should not accept if the resource exists', async () => {
|
|
99
|
-
const message = await commands['validateFileName']('bar', parent);
|
|
100
|
-
(0, chai_1.expect)(message).to.not.equal(''); // a non empty message indicates an error.
|
|
101
|
-
});
|
|
102
|
-
it('should not accept invalid filenames', async () => {
|
|
103
|
-
let message = await commands['validateFileName']('.', parent, true); // invalid filename.
|
|
104
|
-
(0, chai_1.expect)(message).to.not.equal('');
|
|
105
|
-
message = await commands['validateFileName']('/a', parent, true); // invalid starts-with `\`.
|
|
106
|
-
(0, chai_1.expect)(message).to.not.equal('');
|
|
107
|
-
message = await commands['validateFileName'](' a', parent, true); // invalid leading whitespace.
|
|
108
|
-
(0, chai_1.expect)(message).to.not.equal('');
|
|
109
|
-
message = await commands['validateFileName']('a ', parent, true); // invalid trailing whitespace.
|
|
110
|
-
(0, chai_1.expect)(message).to.not.equal('');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
describe('#validateFileRename', () => {
|
|
114
|
-
it('should accept if the resource exists case-insensitively', async () => {
|
|
115
|
-
const oldName = 'bar';
|
|
116
|
-
const newName = 'Bar';
|
|
117
|
-
const message = await commands['validateFileRename'](oldName, newName, parent);
|
|
118
|
-
(0, chai_1.expect)(message).to.equal('');
|
|
119
|
-
});
|
|
120
|
-
it('should accept if the resource does not exist case-insensitively', async () => {
|
|
121
|
-
const oldName = 'bar';
|
|
122
|
-
const newName = 'foo';
|
|
123
|
-
const message = await commands['validateFileRename'](oldName, newName, parent);
|
|
124
|
-
(0, chai_1.expect)(message).to.equal('');
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
});
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
+
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
20
|
+
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
21
|
+
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
22
|
+
const chai_1 = require("chai");
|
|
23
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
const browser_1 = require("@theia/filesystem/lib/browser");
|
|
26
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
27
|
+
const browser_2 = require("@theia/core/lib/browser");
|
|
28
|
+
const common_1 = require("@theia/core/lib/common");
|
|
29
|
+
const selection_service_1 = require("@theia/core/lib/common/selection-service");
|
|
30
|
+
const workspace_commands_1 = require("./workspace-commands");
|
|
31
|
+
const workspace_compare_handler_1 = require("./workspace-compare-handler");
|
|
32
|
+
const workspace_delete_handler_1 = require("./workspace-delete-handler");
|
|
33
|
+
const workspace_duplicate_handler_1 = require("./workspace-duplicate-handler");
|
|
34
|
+
const workspace_preferences_1 = require("./workspace-preferences");
|
|
35
|
+
const workspace_service_1 = require("./workspace-service");
|
|
36
|
+
const application_protocol_1 = require("@theia/core/lib/common/application-protocol");
|
|
37
|
+
const clipboard_service_1 = require("@theia/core/lib/browser/clipboard-service");
|
|
38
|
+
disableJSDOM();
|
|
39
|
+
describe('workspace-commands', () => {
|
|
40
|
+
let commands;
|
|
41
|
+
const childStat = {
|
|
42
|
+
isFile: true,
|
|
43
|
+
isDirectory: false,
|
|
44
|
+
isSymbolicLink: false,
|
|
45
|
+
isReadonly: false,
|
|
46
|
+
resource: new uri_1.default('foo/bar'),
|
|
47
|
+
name: 'bar',
|
|
48
|
+
};
|
|
49
|
+
const parent = {
|
|
50
|
+
isFile: false,
|
|
51
|
+
isDirectory: true,
|
|
52
|
+
isSymbolicLink: false,
|
|
53
|
+
isReadonly: false,
|
|
54
|
+
resource: new uri_1.default('foo'),
|
|
55
|
+
name: 'foo',
|
|
56
|
+
children: [
|
|
57
|
+
childStat
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
before(() => disableJSDOM = (0, jsdom_1.enableJSDOM)());
|
|
61
|
+
after(() => disableJSDOM());
|
|
62
|
+
beforeEach(() => {
|
|
63
|
+
const container = new inversify_1.Container();
|
|
64
|
+
container.bind(browser_1.FileDialogService).toConstantValue({});
|
|
65
|
+
container.bind(file_service_1.FileService).toConstantValue({
|
|
66
|
+
async exists(resource) {
|
|
67
|
+
return resource.path.base.includes('bar'); // 'bar' exists for test purposes.
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
container.bind(browser_2.FrontendApplication).toConstantValue({});
|
|
71
|
+
container.bind(browser_2.LabelProvider).toConstantValue({});
|
|
72
|
+
container.bind(common_1.MessageService).toConstantValue({});
|
|
73
|
+
container.bind(browser_2.OpenerService).toConstantValue({});
|
|
74
|
+
container.bind(selection_service_1.SelectionService).toConstantValue({});
|
|
75
|
+
container.bind(workspace_commands_1.WorkspaceCommandContribution).toSelf().inSingletonScope();
|
|
76
|
+
container.bind(workspace_compare_handler_1.WorkspaceCompareHandler).toConstantValue({});
|
|
77
|
+
container.bind(workspace_delete_handler_1.WorkspaceDeleteHandler).toConstantValue({});
|
|
78
|
+
container.bind(workspace_duplicate_handler_1.WorkspaceDuplicateHandler).toConstantValue({});
|
|
79
|
+
container.bind(workspace_preferences_1.WorkspacePreferences).toConstantValue({});
|
|
80
|
+
container.bind(workspace_service_1.WorkspaceService).toConstantValue({});
|
|
81
|
+
container.bind(clipboard_service_1.ClipboardService).toConstantValue({});
|
|
82
|
+
container.bind(application_protocol_1.ApplicationServer).toConstantValue({
|
|
83
|
+
getBackendOS() {
|
|
84
|
+
return Promise.resolve(common_1.OS.type());
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
commands = container.get(workspace_commands_1.WorkspaceCommandContribution);
|
|
88
|
+
});
|
|
89
|
+
describe('#validateFileName', () => {
|
|
90
|
+
it('should not validate an empty file name', async () => {
|
|
91
|
+
const message = await commands['validateFileName']('', parent);
|
|
92
|
+
(0, chai_1.expect)(message).to.equal('');
|
|
93
|
+
});
|
|
94
|
+
it('should accept the resource does not exist', async () => {
|
|
95
|
+
const message = await commands['validateFileName']('a.ts', parent);
|
|
96
|
+
(0, chai_1.expect)(message).to.equal('');
|
|
97
|
+
});
|
|
98
|
+
it('should not accept if the resource exists', async () => {
|
|
99
|
+
const message = await commands['validateFileName']('bar', parent);
|
|
100
|
+
(0, chai_1.expect)(message).to.not.equal(''); // a non empty message indicates an error.
|
|
101
|
+
});
|
|
102
|
+
it('should not accept invalid filenames', async () => {
|
|
103
|
+
let message = await commands['validateFileName']('.', parent, true); // invalid filename.
|
|
104
|
+
(0, chai_1.expect)(message).to.not.equal('');
|
|
105
|
+
message = await commands['validateFileName']('/a', parent, true); // invalid starts-with `\`.
|
|
106
|
+
(0, chai_1.expect)(message).to.not.equal('');
|
|
107
|
+
message = await commands['validateFileName'](' a', parent, true); // invalid leading whitespace.
|
|
108
|
+
(0, chai_1.expect)(message).to.not.equal('');
|
|
109
|
+
message = await commands['validateFileName']('a ', parent, true); // invalid trailing whitespace.
|
|
110
|
+
(0, chai_1.expect)(message).to.not.equal('');
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('#validateFileRename', () => {
|
|
114
|
+
it('should accept if the resource exists case-insensitively', async () => {
|
|
115
|
+
const oldName = 'bar';
|
|
116
|
+
const newName = 'Bar';
|
|
117
|
+
const message = await commands['validateFileRename'](oldName, newName, parent);
|
|
118
|
+
(0, chai_1.expect)(message).to.equal('');
|
|
119
|
+
});
|
|
120
|
+
it('should accept if the resource does not exist case-insensitively', async () => {
|
|
121
|
+
const oldName = 'bar';
|
|
122
|
+
const newName = 'foo';
|
|
123
|
+
const message = await commands['validateFileRename'](oldName, newName, parent);
|
|
124
|
+
(0, chai_1.expect)(message).to.equal('');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
128
|
//# sourceMappingURL=workspace-commands.spec.js.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
|
|
3
|
-
import { DiffService } from './diff-service';
|
|
4
|
-
export declare class WorkspaceCompareHandler implements UriCommandHandler<URI[]> {
|
|
5
|
-
protected readonly diffService: DiffService;
|
|
6
|
-
/**
|
|
7
|
-
* Determine if the command is visible.
|
|
8
|
-
*
|
|
9
|
-
* @param uris URIs of selected resources.
|
|
10
|
-
* @returns `true` if the command is visible.
|
|
11
|
-
*/
|
|
12
|
-
isVisible(uris: URI[]): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Determine if the command is enabled.
|
|
15
|
-
*
|
|
16
|
-
* @param uris URIs of selected resources.
|
|
17
|
-
* @returns `true` if the command is enabled.
|
|
18
|
-
*/
|
|
19
|
-
isEnabled(uris: URI[]): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Execute the command.
|
|
22
|
-
*
|
|
23
|
-
* @param uris URIs of selected resources.
|
|
24
|
-
*/
|
|
25
|
-
execute(uris: URI[]): Promise<void>;
|
|
26
|
-
}
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
|
|
3
|
+
import { DiffService } from './diff-service';
|
|
4
|
+
export declare class WorkspaceCompareHandler implements UriCommandHandler<URI[]> {
|
|
5
|
+
protected readonly diffService: DiffService;
|
|
6
|
+
/**
|
|
7
|
+
* Determine if the command is visible.
|
|
8
|
+
*
|
|
9
|
+
* @param uris URIs of selected resources.
|
|
10
|
+
* @returns `true` if the command is visible.
|
|
11
|
+
*/
|
|
12
|
+
isVisible(uris: URI[]): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Determine if the command is enabled.
|
|
15
|
+
*
|
|
16
|
+
* @param uris URIs of selected resources.
|
|
17
|
+
* @returns `true` if the command is enabled.
|
|
18
|
+
*/
|
|
19
|
+
isEnabled(uris: URI[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Execute the command.
|
|
22
|
+
*
|
|
23
|
+
* @param uris URIs of selected resources.
|
|
24
|
+
*/
|
|
25
|
+
execute(uris: URI[]): Promise<void>;
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=workspace-compare-handler.d.ts.map
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2019 Red Hat, Inc. 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.WorkspaceCompareHandler = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const diff_service_1 = require("./diff-service");
|
|
30
|
-
let WorkspaceCompareHandler = class WorkspaceCompareHandler {
|
|
31
|
-
/**
|
|
32
|
-
* Determine if the command is visible.
|
|
33
|
-
*
|
|
34
|
-
* @param uris URIs of selected resources.
|
|
35
|
-
* @returns `true` if the command is visible.
|
|
36
|
-
*/
|
|
37
|
-
isVisible(uris) {
|
|
38
|
-
return uris.length === 2;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Determine if the command is enabled.
|
|
42
|
-
*
|
|
43
|
-
* @param uris URIs of selected resources.
|
|
44
|
-
* @returns `true` if the command is enabled.
|
|
45
|
-
*/
|
|
46
|
-
isEnabled(uris) {
|
|
47
|
-
return uris.length === 2;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Execute the command.
|
|
51
|
-
*
|
|
52
|
-
* @param uris URIs of selected resources.
|
|
53
|
-
*/
|
|
54
|
-
async execute(uris) {
|
|
55
|
-
const [left, right] = uris;
|
|
56
|
-
await this.diffService.openDiffEditor(left, right);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, inversify_1.inject)(diff_service_1.DiffService),
|
|
61
|
-
__metadata("design:type", diff_service_1.DiffService)
|
|
62
|
-
], WorkspaceCompareHandler.prototype, "diffService", void 0);
|
|
63
|
-
WorkspaceCompareHandler = __decorate([
|
|
64
|
-
(0, inversify_1.injectable)()
|
|
65
|
-
], WorkspaceCompareHandler);
|
|
66
|
-
exports.WorkspaceCompareHandler = WorkspaceCompareHandler;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. 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.WorkspaceCompareHandler = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const diff_service_1 = require("./diff-service");
|
|
30
|
+
let WorkspaceCompareHandler = class WorkspaceCompareHandler {
|
|
31
|
+
/**
|
|
32
|
+
* Determine if the command is visible.
|
|
33
|
+
*
|
|
34
|
+
* @param uris URIs of selected resources.
|
|
35
|
+
* @returns `true` if the command is visible.
|
|
36
|
+
*/
|
|
37
|
+
isVisible(uris) {
|
|
38
|
+
return uris.length === 2;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Determine if the command is enabled.
|
|
42
|
+
*
|
|
43
|
+
* @param uris URIs of selected resources.
|
|
44
|
+
* @returns `true` if the command is enabled.
|
|
45
|
+
*/
|
|
46
|
+
isEnabled(uris) {
|
|
47
|
+
return uris.length === 2;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Execute the command.
|
|
51
|
+
*
|
|
52
|
+
* @param uris URIs of selected resources.
|
|
53
|
+
*/
|
|
54
|
+
async execute(uris) {
|
|
55
|
+
const [left, right] = uris;
|
|
56
|
+
await this.diffService.openDiffEditor(left, right);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, inversify_1.inject)(diff_service_1.DiffService),
|
|
61
|
+
__metadata("design:type", diff_service_1.DiffService)
|
|
62
|
+
], WorkspaceCompareHandler.prototype, "diffService", void 0);
|
|
63
|
+
WorkspaceCompareHandler = __decorate([
|
|
64
|
+
(0, inversify_1.injectable)()
|
|
65
|
+
], WorkspaceCompareHandler);
|
|
66
|
+
exports.WorkspaceCompareHandler = WorkspaceCompareHandler;
|
|
67
67
|
//# sourceMappingURL=workspace-compare-handler.js.map
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { ApplicationShell } from '@theia/core/lib/browser';
|
|
3
|
-
import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
|
|
4
|
-
import { WorkspaceService } from './workspace-service';
|
|
5
|
-
import { WorkspaceUtils } from './workspace-utils';
|
|
6
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
7
|
-
import { FileSystemPreferences } from '@theia/filesystem/lib/browser/filesystem-preferences';
|
|
8
|
-
import { FileDeleteOptions } from '@theia/filesystem/lib/common/files';
|
|
9
|
-
export declare class WorkspaceDeleteHandler implements UriCommandHandler<URI[]> {
|
|
10
|
-
protected readonly fileService: FileService;
|
|
11
|
-
protected readonly shell: ApplicationShell;
|
|
12
|
-
protected readonly workspaceUtils: WorkspaceUtils;
|
|
13
|
-
protected readonly workspaceService: WorkspaceService;
|
|
14
|
-
protected readonly fsPreferences: FileSystemPreferences;
|
|
15
|
-
/**
|
|
16
|
-
* Determine if the command is visible.
|
|
17
|
-
*
|
|
18
|
-
* @param uris URIs of selected resources.
|
|
19
|
-
* @returns `true` if the command is visible.
|
|
20
|
-
*/
|
|
21
|
-
isVisible(uris: URI[]): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Determine if the command is enabled.
|
|
24
|
-
*
|
|
25
|
-
* @param uris URIs of selected resources.
|
|
26
|
-
* @returns `true` if the command is enabled.
|
|
27
|
-
*/
|
|
28
|
-
isEnabled(uris: URI[]): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Execute the command.
|
|
31
|
-
*
|
|
32
|
-
* @param uris URIs of selected resources.
|
|
33
|
-
*/
|
|
34
|
-
execute(uris: URI[]): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Display dialog to confirm deletion.
|
|
37
|
-
*
|
|
38
|
-
* @param uris URIs of selected resources.
|
|
39
|
-
*/
|
|
40
|
-
protected confirm(uris: URI[], options: FileDeleteOptions): Promise<boolean | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
* Get the dialog confirmation message for deletion.
|
|
43
|
-
*
|
|
44
|
-
* @param uris URIs of selected resources.
|
|
45
|
-
*/
|
|
46
|
-
protected getConfirmMessage(uris: URI[]): string | HTMLElement;
|
|
47
|
-
/**
|
|
48
|
-
* Get which URI are presently dirty.
|
|
49
|
-
*
|
|
50
|
-
* @param uris URIs of selected resources.
|
|
51
|
-
* @returns An array of dirty URI.
|
|
52
|
-
*/
|
|
53
|
-
protected getDirty(uris: URI[]): URI[];
|
|
54
|
-
/**
|
|
55
|
-
* Perform deletion of a given URI.
|
|
56
|
-
*
|
|
57
|
-
* @param uri URI of selected resource.
|
|
58
|
-
* @param options deletion options.
|
|
59
|
-
*/
|
|
60
|
-
protected delete(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
61
|
-
protected deleteFilePermanently(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
62
|
-
protected moveFileToTrash(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Display dialog to confirm the permanent deletion of a file.
|
|
65
|
-
*
|
|
66
|
-
* @param uri URI of selected resource.
|
|
67
|
-
*/
|
|
68
|
-
protected confirmDeletePermanently(uri: URI): Promise<boolean>;
|
|
69
|
-
/**
|
|
70
|
-
* Close widget without saving changes.
|
|
71
|
-
*
|
|
72
|
-
* @param uri URI of a selected resource.
|
|
73
|
-
*/
|
|
74
|
-
protected closeWithoutSaving(uri: URI): Promise<void>;
|
|
75
|
-
}
|
|
1
|
+
import URI from '@theia/core/lib/common/uri';
|
|
2
|
+
import { ApplicationShell } from '@theia/core/lib/browser';
|
|
3
|
+
import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
|
|
4
|
+
import { WorkspaceService } from './workspace-service';
|
|
5
|
+
import { WorkspaceUtils } from './workspace-utils';
|
|
6
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
7
|
+
import { FileSystemPreferences } from '@theia/filesystem/lib/browser/filesystem-preferences';
|
|
8
|
+
import { FileDeleteOptions } from '@theia/filesystem/lib/common/files';
|
|
9
|
+
export declare class WorkspaceDeleteHandler implements UriCommandHandler<URI[]> {
|
|
10
|
+
protected readonly fileService: FileService;
|
|
11
|
+
protected readonly shell: ApplicationShell;
|
|
12
|
+
protected readonly workspaceUtils: WorkspaceUtils;
|
|
13
|
+
protected readonly workspaceService: WorkspaceService;
|
|
14
|
+
protected readonly fsPreferences: FileSystemPreferences;
|
|
15
|
+
/**
|
|
16
|
+
* Determine if the command is visible.
|
|
17
|
+
*
|
|
18
|
+
* @param uris URIs of selected resources.
|
|
19
|
+
* @returns `true` if the command is visible.
|
|
20
|
+
*/
|
|
21
|
+
isVisible(uris: URI[]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Determine if the command is enabled.
|
|
24
|
+
*
|
|
25
|
+
* @param uris URIs of selected resources.
|
|
26
|
+
* @returns `true` if the command is enabled.
|
|
27
|
+
*/
|
|
28
|
+
isEnabled(uris: URI[]): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Execute the command.
|
|
31
|
+
*
|
|
32
|
+
* @param uris URIs of selected resources.
|
|
33
|
+
*/
|
|
34
|
+
execute(uris: URI[]): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Display dialog to confirm deletion.
|
|
37
|
+
*
|
|
38
|
+
* @param uris URIs of selected resources.
|
|
39
|
+
*/
|
|
40
|
+
protected confirm(uris: URI[], options: FileDeleteOptions): Promise<boolean | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the dialog confirmation message for deletion.
|
|
43
|
+
*
|
|
44
|
+
* @param uris URIs of selected resources.
|
|
45
|
+
*/
|
|
46
|
+
protected getConfirmMessage(uris: URI[]): string | HTMLElement;
|
|
47
|
+
/**
|
|
48
|
+
* Get which URI are presently dirty.
|
|
49
|
+
*
|
|
50
|
+
* @param uris URIs of selected resources.
|
|
51
|
+
* @returns An array of dirty URI.
|
|
52
|
+
*/
|
|
53
|
+
protected getDirty(uris: URI[]): URI[];
|
|
54
|
+
/**
|
|
55
|
+
* Perform deletion of a given URI.
|
|
56
|
+
*
|
|
57
|
+
* @param uri URI of selected resource.
|
|
58
|
+
* @param options deletion options.
|
|
59
|
+
*/
|
|
60
|
+
protected delete(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
61
|
+
protected deleteFilePermanently(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
62
|
+
protected moveFileToTrash(uri: URI, options: FileDeleteOptions): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Display dialog to confirm the permanent deletion of a file.
|
|
65
|
+
*
|
|
66
|
+
* @param uri URI of selected resource.
|
|
67
|
+
*/
|
|
68
|
+
protected confirmDeletePermanently(uri: URI): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Close widget without saving changes.
|
|
71
|
+
*
|
|
72
|
+
* @param uri URI of a selected resource.
|
|
73
|
+
*/
|
|
74
|
+
protected closeWithoutSaving(uri: URI): Promise<void>;
|
|
75
|
+
}
|
|
76
76
|
//# sourceMappingURL=workspace-delete-handler.d.ts.map
|