@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.
Files changed (118) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/canonical-uri-service.d.ts +11 -11
  3. package/lib/browser/canonical-uri-service.js +59 -59
  4. package/lib/browser/diff-service.d.ts +10 -10
  5. package/lib/browser/diff-service.js +85 -85
  6. package/lib/browser/index.d.ts +7 -7
  7. package/lib/browser/index.js +34 -34
  8. package/lib/browser/quick-open-workspace.d.ts +25 -25
  9. package/lib/browser/quick-open-workspace.js +137 -137
  10. package/lib/browser/untitled-workspace-exit-dialog.d.ts +19 -19
  11. package/lib/browser/untitled-workspace-exit-dialog.js +74 -74
  12. package/lib/browser/workspace-breadcrumbs-contribution.d.ts +10 -10
  13. package/lib/browser/workspace-breadcrumbs-contribution.js +66 -66
  14. package/lib/browser/workspace-commands.d.ts +117 -117
  15. package/lib/browser/workspace-commands.js +601 -601
  16. package/lib/browser/workspace-commands.spec.d.ts +1 -1
  17. package/lib/browser/workspace-commands.spec.js +127 -127
  18. package/lib/browser/workspace-compare-handler.d.ts +26 -26
  19. package/lib/browser/workspace-compare-handler.js +66 -66
  20. package/lib/browser/workspace-delete-handler.d.ts +75 -75
  21. package/lib/browser/workspace-delete-handler.js +214 -214
  22. package/lib/browser/workspace-duplicate-handler.d.ts +30 -30
  23. package/lib/browser/workspace-duplicate-handler.js +86 -86
  24. package/lib/browser/workspace-frontend-contribution.d.ts +110 -110
  25. package/lib/browser/workspace-frontend-contribution.js +546 -546
  26. package/lib/browser/workspace-frontend-contribution.js.map +1 -1
  27. package/lib/browser/workspace-frontend-module.d.ts +3 -3
  28. package/lib/browser/workspace-frontend-module.js +91 -91
  29. package/lib/browser/workspace-input-dialog.d.ts +19 -19
  30. package/lib/browser/workspace-input-dialog.js +74 -74
  31. package/lib/browser/workspace-preferences.d.ts +11 -11
  32. package/lib/browser/workspace-preferences.js +46 -46
  33. package/lib/browser/workspace-schema-updater.d.ts +34 -34
  34. package/lib/browser/workspace-schema-updater.js +153 -153
  35. package/lib/browser/workspace-service.d.ts +184 -184
  36. package/lib/browser/workspace-service.js +739 -739
  37. package/lib/browser/workspace-storage-service.d.ts +15 -15
  38. package/lib/browser/workspace-storage-service.js +80 -80
  39. package/lib/browser/workspace-trust-preferences.d.ts +21 -21
  40. package/lib/browser/workspace-trust-preferences.js +65 -65
  41. package/lib/browser/workspace-trust-service.d.ts +27 -27
  42. package/lib/browser/workspace-trust-service.js +152 -152
  43. package/lib/browser/workspace-uri-contribution.d.ts +20 -20
  44. package/lib/browser/workspace-uri-contribution.js +113 -113
  45. package/lib/browser/workspace-uri-contribution.spec.d.ts +1 -1
  46. package/lib/browser/workspace-uri-contribution.spec.js +169 -169
  47. package/lib/browser/workspace-user-working-directory-provider.d.ts +12 -12
  48. package/lib/browser/workspace-user-working-directory-provider.js +62 -62
  49. package/lib/browser/workspace-utils.d.ts +15 -15
  50. package/lib/browser/workspace-utils.js +54 -54
  51. package/lib/browser/workspace-variable-contribution.d.ts +23 -23
  52. package/lib/browser/workspace-variable-contribution.js +237 -237
  53. package/lib/browser/workspace-window-title-updater.d.ts +7 -7
  54. package/lib/browser/workspace-window-title-updater.js +57 -57
  55. package/lib/browser-only/browser-only-workspace-server.d.ts +13 -0
  56. package/lib/browser-only/browser-only-workspace-server.d.ts.map +1 -0
  57. package/lib/browser-only/browser-only-workspace-server.js +81 -0
  58. package/lib/browser-only/browser-only-workspace-server.js.map +1 -0
  59. package/lib/browser-only/workspace-frontend-only-module.d.ts +4 -0
  60. package/lib/browser-only/workspace-frontend-only-module.d.ts.map +1 -0
  61. package/lib/browser-only/workspace-frontend-only-module.js +30 -0
  62. package/lib/browser-only/workspace-frontend-only-module.js.map +1 -0
  63. package/lib/common/index.d.ts +3 -3
  64. package/lib/common/index.js +30 -30
  65. package/lib/common/test/mock-workspace-server.d.ts +7 -7
  66. package/lib/common/test/mock-workspace-server.js +35 -35
  67. package/lib/common/untitled-workspace-service.d.ts +8 -8
  68. package/lib/common/untitled-workspace-service.js +60 -60
  69. package/lib/common/workspace-file-service.d.ts +26 -26
  70. package/lib/common/workspace-file-service.js +71 -71
  71. package/lib/common/workspace-protocol.d.ts +26 -26
  72. package/lib/common/workspace-protocol.js +23 -23
  73. package/lib/node/default-workspace-server.d.ts +65 -65
  74. package/lib/node/default-workspace-server.js +248 -248
  75. package/lib/node/default-workspace-server.spec.d.ts +1 -1
  76. package/lib/node/default-workspace-server.spec.js +85 -85
  77. package/lib/node/index.d.ts +2 -2
  78. package/lib/node/index.js +29 -29
  79. package/lib/node/workspace-backend-module.d.ts +3 -3
  80. package/lib/node/workspace-backend-module.js +33 -33
  81. package/package.json +9 -6
  82. package/src/browser/canonical-uri-service.ts +57 -57
  83. package/src/browser/diff-service.ts +62 -62
  84. package/src/browser/index.ts +23 -23
  85. package/src/browser/quick-open-workspace.ts +112 -112
  86. package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
  87. package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
  88. package/src/browser/workspace-commands.spec.ts +153 -153
  89. package/src/browser/workspace-commands.ts +588 -588
  90. package/src/browser/workspace-compare-handler.ts +56 -56
  91. package/src/browser/workspace-delete-handler.ts +212 -212
  92. package/src/browser/workspace-duplicate-handler.ts +75 -75
  93. package/src/browser/workspace-frontend-contribution.ts +537 -537
  94. package/src/browser/workspace-frontend-module.ts +118 -118
  95. package/src/browser/workspace-input-dialog.ts +61 -61
  96. package/src/browser/workspace-preferences.ts +58 -58
  97. package/src/browser/workspace-schema-updater.ts +150 -150
  98. package/src/browser/workspace-service.ts +780 -780
  99. package/src/browser/workspace-storage-service.ts +67 -67
  100. package/src/browser/workspace-trust-preferences.ts +76 -76
  101. package/src/browser/workspace-trust-service.ts +147 -147
  102. package/src/browser/workspace-uri-contribution.spec.ts +191 -191
  103. package/src/browser/workspace-uri-contribution.ts +97 -97
  104. package/src/browser/workspace-user-working-directory-provider.ts +49 -49
  105. package/src/browser/workspace-utils.ts +45 -45
  106. package/src/browser/workspace-variable-contribution.ts +222 -222
  107. package/src/browser/workspace-window-title-updater.ts +45 -45
  108. package/src/browser-only/browser-only-workspace-server.ts +69 -0
  109. package/src/browser-only/workspace-frontend-only-module.ts +28 -0
  110. package/src/common/index.ts +19 -19
  111. package/src/common/test/mock-workspace-server.ts +29 -29
  112. package/src/common/untitled-workspace-service.ts +50 -50
  113. package/src/common/workspace-file-service.ts +72 -72
  114. package/src/common/workspace-protocol.ts +47 -47
  115. package/src/node/default-workspace-server.spec.ts +100 -100
  116. package/src/node/default-workspace-server.ts +244 -244
  117. package/src/node/index.ts +18 -18
  118. package/src/node/workspace-backend-module.ts +38 -38
@@ -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-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.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-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.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
@@ -0,0 +1,13 @@
1
+ import { WorkspaceServer } from '../common/workspace-protocol';
2
+ import { ILogger } from '@theia/core';
3
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
4
+ export declare const RECENT_WORKSPACES_LOCAL_STORAGE_KEY = "workspaces";
5
+ export declare class BrowserOnlyWorkspaceServer implements WorkspaceServer {
6
+ protected logger: ILogger;
7
+ protected readonly fileService: FileService;
8
+ getRecentWorkspaces(): Promise<string[]>;
9
+ getMostRecentlyUsedWorkspace(): Promise<string | undefined>;
10
+ setMostRecentlyUsedWorkspace(uri: string): Promise<void>;
11
+ removeRecentWorkspace(uri: string): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=browser-only-workspace-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-only-workspace-server.d.ts","sourceRoot":"","sources":["../../src/browser-only/browser-only-workspace-server.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAEzE,eAAO,MAAM,mCAAmC,eAAe,CAAC;AAEhE,qBACa,0BAA2B,YAAW,eAAe;IAG9D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAG1B,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAEtC,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAiBxC,4BAA4B,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3D,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxD,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1D"}
@@ -0,0 +1,81 @@
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
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BrowserOnlyWorkspaceServer = exports.RECENT_WORKSPACES_LOCAL_STORAGE_KEY = void 0;
13
+ // *****************************************************************************
14
+ // Copyright (C) 2023 EclipseSource and others.
15
+ //
16
+ // This program and the accompanying materials are made available under the
17
+ // terms of the Eclipse Public License v. 2.0 which is available at
18
+ // http://www.eclipse.org/legal/epl-2.0.
19
+ //
20
+ // This Source Code may also be made available under the following Secondary
21
+ // Licenses when the conditions for such availability set forth in the Eclipse
22
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ // with the GNU Classpath Exception which is available at
24
+ // https://www.gnu.org/software/classpath/license.html.
25
+ //
26
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
27
+ // *****************************************************************************
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const core_1 = require("@theia/core");
30
+ const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
31
+ exports.RECENT_WORKSPACES_LOCAL_STORAGE_KEY = 'workspaces';
32
+ let BrowserOnlyWorkspaceServer = class BrowserOnlyWorkspaceServer {
33
+ async getRecentWorkspaces() {
34
+ const storedWorkspaces = localStorage.getItem(exports.RECENT_WORKSPACES_LOCAL_STORAGE_KEY);
35
+ if (!storedWorkspaces) {
36
+ return [];
37
+ }
38
+ try {
39
+ const parsedWorkspaces = JSON.parse(storedWorkspaces);
40
+ if ((0, core_1.isStringArray)(parsedWorkspaces)) {
41
+ return parsedWorkspaces;
42
+ }
43
+ }
44
+ catch (e) {
45
+ this.logger.error(e);
46
+ return [];
47
+ }
48
+ return [];
49
+ }
50
+ async getMostRecentlyUsedWorkspace() {
51
+ const workspaces = await this.getRecentWorkspaces();
52
+ return workspaces[0];
53
+ }
54
+ async setMostRecentlyUsedWorkspace(uri) {
55
+ const workspaces = await this.getRecentWorkspaces();
56
+ if (workspaces.includes(uri)) {
57
+ workspaces.splice(workspaces.indexOf(uri), 1);
58
+ }
59
+ localStorage.setItem(exports.RECENT_WORKSPACES_LOCAL_STORAGE_KEY, JSON.stringify([uri, ...workspaces]));
60
+ }
61
+ async removeRecentWorkspace(uri) {
62
+ const workspaces = await this.getRecentWorkspaces();
63
+ if (workspaces.includes(uri)) {
64
+ workspaces.splice(workspaces.indexOf(uri), 1);
65
+ }
66
+ localStorage.setItem(exports.RECENT_WORKSPACES_LOCAL_STORAGE_KEY, JSON.stringify(workspaces));
67
+ }
68
+ };
69
+ __decorate([
70
+ (0, inversify_1.inject)(core_1.ILogger),
71
+ __metadata("design:type", Object)
72
+ ], BrowserOnlyWorkspaceServer.prototype, "logger", void 0);
73
+ __decorate([
74
+ (0, inversify_1.inject)(file_service_1.FileService),
75
+ __metadata("design:type", file_service_1.FileService)
76
+ ], BrowserOnlyWorkspaceServer.prototype, "fileService", void 0);
77
+ BrowserOnlyWorkspaceServer = __decorate([
78
+ (0, inversify_1.injectable)()
79
+ ], BrowserOnlyWorkspaceServer);
80
+ exports.BrowserOnlyWorkspaceServer = BrowserOnlyWorkspaceServer;
81
+ //# sourceMappingURL=browser-only-workspace-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-only-workspace-server.js","sourceRoot":"","sources":["../../src/browser-only/browser-only-workspace-server.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,4DAAkE;AAElE,sCAAqD;AACrD,6EAAyE;AAE5D,QAAA,mCAAmC,GAAG,YAAY,CAAC;AAGhE,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAQnC,KAAK,CAAC,mBAAmB;QACrB,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,CAAC,2CAAmC,CAAC,CAAC;QACnF,IAAI,CAAC,gBAAgB,EAAE;YACnB,OAAO,EAAE,CAAC;SACb;QACD,IAAI;YACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACtD,IAAI,IAAA,oBAAa,EAAC,gBAAgB,CAAC,EAAE;gBACjC,OAAO,gBAAgB,CAAC;aAC3B;SACJ;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACrB,OAAO,EAAE,CAAC;SACb;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,KAAK,CAAC,4BAA4B;QAC9B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACpD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,4BAA4B,CAAC,GAAW;QAC1C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACpD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC1B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;SACjD;QACD,YAAY,CAAC,OAAO,CAAC,2CAAmC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,GAAW;QACnC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACpD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC1B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;SACjD;QACD,YAAY,CAAC,OAAO,CAAC,2CAAmC,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1F,CAAC;CACJ,CAAA;AA1CG;IADC,IAAA,kBAAM,EAAC,cAAO,CAAC;;0DACU;AAG1B;IADC,IAAA,kBAAM,EAAC,0BAAW,CAAC;8BACY,0BAAW;+DAAC;AANnC,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA6CtC;AA7CY,gEAA0B"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=workspace-frontend-only-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-frontend-only-module.d.ts","sourceRoot":"","sources":["../../src/browser-only/workspace-frontend-only-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;;AAI3E,wBAOG"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 EclipseSource 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 browser_only_workspace_server_1 = require("./browser-only-workspace-server");
20
+ const common_1 = require("../common");
21
+ exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
22
+ bind(browser_only_workspace_server_1.BrowserOnlyWorkspaceServer).toSelf().inSingletonScope();
23
+ if (isBound(common_1.WorkspaceServer)) {
24
+ rebind(common_1.WorkspaceServer).toService(browser_only_workspace_server_1.BrowserOnlyWorkspaceServer);
25
+ }
26
+ else {
27
+ bind(common_1.WorkspaceServer).toService(browser_only_workspace_server_1.BrowserOnlyWorkspaceServer);
28
+ }
29
+ });
30
+ //# sourceMappingURL=workspace-frontend-only-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-frontend-only-module.js","sourceRoot":"","sources":["../../src/browser-only/workspace-frontend-only-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4DAA2E;AAC3E,mFAA6E;AAC7E,sCAA4C;AAE5C,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,MAAyB,EAAE,OAA2B,EAAE,MAAyB,EAAE,EAAE;IAC5I,IAAI,CAAC,0DAA0B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7D,IAAI,OAAO,CAAC,wBAAe,CAAC,EAAE;QAC1B,MAAM,CAAC,wBAAe,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;KACjE;SAAM;QACH,IAAI,CAAC,wBAAe,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;KAC/D;AACL,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './workspace-protocol';
2
- export * from './workspace-file-service';
3
- export * from './untitled-workspace-service';
1
+ export * from './workspace-protocol';
2
+ export * from './workspace-file-service';
3
+ export * from './untitled-workspace-service';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,31 +1,31 @@
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("./workspace-protocol"), exports);
29
- __exportStar(require("./workspace-file-service"), exports);
30
- __exportStar(require("./untitled-workspace-service"), 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("./workspace-protocol"), exports);
29
+ __exportStar(require("./workspace-file-service"), exports);
30
+ __exportStar(require("./untitled-workspace-service"), exports);
31
31
  //# 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-only 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-only 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
@@ -1,9 +1,9 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { MaybePromise } from '@theia/core';
3
- import { WorkspaceFileService } from './workspace-file-service';
4
- export declare class UntitledWorkspaceService {
5
- protected readonly workspaceFileService: WorkspaceFileService;
6
- isUntitledWorkspace(candidate?: URI): boolean;
7
- getUntitledWorkspaceUri(configDirUri: URI, isAcceptable: (candidate: URI) => MaybePromise<boolean>, warnOnHits?: () => unknown): Promise<URI>;
8
- }
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { MaybePromise } from '@theia/core';
3
+ import { WorkspaceFileService } from './workspace-file-service';
4
+ export declare class UntitledWorkspaceService {
5
+ protected readonly workspaceFileService: WorkspaceFileService;
6
+ isUntitledWorkspace(candidate?: URI): boolean;
7
+ getUntitledWorkspaceUri(configDirUri: URI, isAcceptable: (candidate: URI) => MaybePromise<boolean>, warnOnHits?: () => unknown): Promise<URI>;
8
+ }
9
9
  //# sourceMappingURL=untitled-workspace-service.d.ts.map
@@ -1,61 +1,61 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.UntitledWorkspaceService = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const workspace_file_service_1 = require("./workspace-file-service");
30
- let UntitledWorkspaceService = class UntitledWorkspaceService {
31
- isUntitledWorkspace(candidate) {
32
- return !!candidate && this.workspaceFileService.isWorkspaceFile(candidate) && candidate.path.base.startsWith('Untitled');
33
- }
34
- async getUntitledWorkspaceUri(configDirUri, isAcceptable, warnOnHits) {
35
- const parentDir = configDirUri.resolve('workspaces');
36
- const workspaceExtensions = this.workspaceFileService.getWorkspaceFileExtensions();
37
- const defaultFileExtension = workspaceExtensions[this.workspaceFileService.defaultFileTypeIndex];
38
- let uri;
39
- let attempts = 0;
40
- do {
41
- attempts++;
42
- uri = parentDir.resolve(`Untitled-${Math.round(Math.random() * 1000)}.${defaultFileExtension}`);
43
- if (attempts === 10) {
44
- warnOnHits === null || warnOnHits === void 0 ? void 0 : warnOnHits();
45
- }
46
- if (attempts === 50) {
47
- throw new Error('Workspace Service: too many attempts to find unused filename.');
48
- }
49
- } while (!(await isAcceptable(uri)));
50
- return uri;
51
- }
52
- };
53
- __decorate([
54
- (0, inversify_1.inject)(workspace_file_service_1.WorkspaceFileService),
55
- __metadata("design:type", workspace_file_service_1.WorkspaceFileService)
56
- ], UntitledWorkspaceService.prototype, "workspaceFileService", void 0);
57
- UntitledWorkspaceService = __decorate([
58
- (0, inversify_1.injectable)()
59
- ], UntitledWorkspaceService);
60
- exports.UntitledWorkspaceService = UntitledWorkspaceService;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.UntitledWorkspaceService = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const workspace_file_service_1 = require("./workspace-file-service");
30
+ let UntitledWorkspaceService = class UntitledWorkspaceService {
31
+ isUntitledWorkspace(candidate) {
32
+ return !!candidate && this.workspaceFileService.isWorkspaceFile(candidate) && candidate.path.base.startsWith('Untitled');
33
+ }
34
+ async getUntitledWorkspaceUri(configDirUri, isAcceptable, warnOnHits) {
35
+ const parentDir = configDirUri.resolve('workspaces');
36
+ const workspaceExtensions = this.workspaceFileService.getWorkspaceFileExtensions();
37
+ const defaultFileExtension = workspaceExtensions[this.workspaceFileService.defaultFileTypeIndex];
38
+ let uri;
39
+ let attempts = 0;
40
+ do {
41
+ attempts++;
42
+ uri = parentDir.resolve(`Untitled-${Math.round(Math.random() * 1000)}.${defaultFileExtension}`);
43
+ if (attempts === 10) {
44
+ warnOnHits === null || warnOnHits === void 0 ? void 0 : warnOnHits();
45
+ }
46
+ if (attempts === 50) {
47
+ throw new Error('Workspace Service: too many attempts to find unused filename.');
48
+ }
49
+ } while (!(await isAcceptable(uri)));
50
+ return uri;
51
+ }
52
+ };
53
+ __decorate([
54
+ (0, inversify_1.inject)(workspace_file_service_1.WorkspaceFileService),
55
+ __metadata("design:type", workspace_file_service_1.WorkspaceFileService)
56
+ ], UntitledWorkspaceService.prototype, "workspaceFileService", void 0);
57
+ UntitledWorkspaceService = __decorate([
58
+ (0, inversify_1.injectable)()
59
+ ], UntitledWorkspaceService);
60
+ exports.UntitledWorkspaceService = UntitledWorkspaceService;
61
61
  //# sourceMappingURL=untitled-workspace-service.js.map