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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/workspace-commands.js +2 -2
  3. package/lib/browser/workspace-commands.js.map +1 -1
  4. package/lib/browser/workspace-service.js +1 -1
  5. package/lib/browser/workspace-service.js.map +1 -1
  6. package/package.json +6 -6
  7. package/src/browser/canonical-uri-service.ts +57 -57
  8. package/src/browser/diff-service.ts +62 -62
  9. package/src/browser/index.ts +23 -23
  10. package/src/browser/quick-open-workspace.ts +112 -112
  11. package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
  12. package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
  13. package/src/browser/workspace-commands.spec.ts +153 -153
  14. package/src/browser/workspace-commands.ts +557 -557
  15. package/src/browser/workspace-compare-handler.ts +56 -56
  16. package/src/browser/workspace-delete-handler.ts +212 -212
  17. package/src/browser/workspace-duplicate-handler.ts +75 -75
  18. package/src/browser/workspace-frontend-contribution.ts +537 -537
  19. package/src/browser/workspace-frontend-module.ts +118 -118
  20. package/src/browser/workspace-input-dialog.ts +61 -61
  21. package/src/browser/workspace-preferences.ts +58 -58
  22. package/src/browser/workspace-schema-updater.ts +150 -150
  23. package/src/browser/workspace-service.ts +780 -780
  24. package/src/browser/workspace-storage-service.ts +67 -67
  25. package/src/browser/workspace-trust-preferences.ts +76 -76
  26. package/src/browser/workspace-trust-service.ts +152 -152
  27. package/src/browser/workspace-uri-contribution.spec.ts +191 -191
  28. package/src/browser/workspace-uri-contribution.ts +97 -97
  29. package/src/browser/workspace-user-working-directory-provider.ts +49 -49
  30. package/src/browser/workspace-utils.ts +45 -45
  31. package/src/browser/workspace-variable-contribution.ts +222 -222
  32. package/src/browser/workspace-window-title-updater.ts +45 -45
  33. package/src/browser-only/browser-only-workspace-server.ts +69 -69
  34. package/src/browser-only/workspace-frontend-only-module.ts +28 -28
  35. package/src/common/index.ts +19 -19
  36. package/src/common/test/mock-workspace-server.ts +29 -29
  37. package/src/common/untitled-workspace-service.ts +50 -50
  38. package/src/common/workspace-file-service.ts +72 -72
  39. package/src/common/workspace-protocol.ts +47 -47
  40. package/src/node/default-workspace-server.spec.ts +100 -100
  41. package/src/node/default-workspace-server.ts +244 -244
  42. package/src/node/index.ts +18 -18
  43. package/src/node/workspace-backend-module.ts +38 -38
@@ -1,75 +1,75 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import URI from '@theia/core/lib/common/uri';
18
- import { injectable, inject } from '@theia/core/shared/inversify';
19
- import { WorkspaceUtils } from './workspace-utils';
20
- import { WorkspaceService } from './workspace-service';
21
- import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
22
- import { FileSystemUtils } from '@theia/filesystem/lib/common/filesystem-utils';
23
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
24
-
25
- @injectable()
26
- export class WorkspaceDuplicateHandler implements UriCommandHandler<URI[]> {
27
-
28
- @inject(FileService)
29
- protected readonly fileService: FileService;
30
-
31
- @inject(WorkspaceUtils)
32
- protected readonly workspaceUtils: WorkspaceUtils;
33
-
34
- @inject(WorkspaceService)
35
- protected readonly workspaceService: WorkspaceService;
36
-
37
- /**
38
- * Determine if the command is visible.
39
- *
40
- * @param uris URIs of selected resources.
41
- * @returns `true` if the command is visible.
42
- */
43
- isVisible(uris: URI[]): boolean {
44
- return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
45
- }
46
-
47
- /**
48
- * Determine if the command is enabled.
49
- *
50
- * @param uris URIs of selected resources.
51
- * @returns `true` if the command is enabled.
52
- */
53
- isEnabled(uris: URI[]): boolean {
54
- return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
55
- }
56
-
57
- /**
58
- * Execute the command.
59
- *
60
- * @param uris URIs of selected resources.
61
- */
62
- async execute(uris: URI[]): Promise<void> {
63
- await Promise.all(uris.map(async uri => {
64
- try {
65
- const parent = await this.fileService.resolve(uri.parent);
66
- const targetFileStat = await this.fileService.resolve(uri);
67
- const target = FileSystemUtils.generateUniqueResourceURI(parent, uri, targetFileStat.isDirectory, 'copy');
68
- await this.fileService.copy(uri, target);
69
- } catch (e) {
70
- console.error(e);
71
- }
72
- }));
73
- }
74
-
75
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import URI from '@theia/core/lib/common/uri';
18
+ import { injectable, inject } from '@theia/core/shared/inversify';
19
+ import { WorkspaceUtils } from './workspace-utils';
20
+ import { WorkspaceService } from './workspace-service';
21
+ import { UriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
22
+ import { FileSystemUtils } from '@theia/filesystem/lib/common/filesystem-utils';
23
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
24
+
25
+ @injectable()
26
+ export class WorkspaceDuplicateHandler implements UriCommandHandler<URI[]> {
27
+
28
+ @inject(FileService)
29
+ protected readonly fileService: FileService;
30
+
31
+ @inject(WorkspaceUtils)
32
+ protected readonly workspaceUtils: WorkspaceUtils;
33
+
34
+ @inject(WorkspaceService)
35
+ protected readonly workspaceService: WorkspaceService;
36
+
37
+ /**
38
+ * Determine if the command is visible.
39
+ *
40
+ * @param uris URIs of selected resources.
41
+ * @returns `true` if the command is visible.
42
+ */
43
+ isVisible(uris: URI[]): boolean {
44
+ return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
45
+ }
46
+
47
+ /**
48
+ * Determine if the command is enabled.
49
+ *
50
+ * @param uris URIs of selected resources.
51
+ * @returns `true` if the command is enabled.
52
+ */
53
+ isEnabled(uris: URI[]): boolean {
54
+ return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
55
+ }
56
+
57
+ /**
58
+ * Execute the command.
59
+ *
60
+ * @param uris URIs of selected resources.
61
+ */
62
+ async execute(uris: URI[]): Promise<void> {
63
+ await Promise.all(uris.map(async uri => {
64
+ try {
65
+ const parent = await this.fileService.resolve(uri.parent);
66
+ const targetFileStat = await this.fileService.resolve(uri);
67
+ const target = FileSystemUtils.generateUniqueResourceURI(parent, uri, targetFileStat.isDirectory, 'copy');
68
+ await this.fileService.copy(uri, target);
69
+ } catch (e) {
70
+ console.error(e);
71
+ }
72
+ }));
73
+ }
74
+
75
+ }