@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,87 +1,87 @@
|
|
|
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.WorkspaceDuplicateHandler = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const workspace_utils_1 = require("./workspace-utils");
|
|
30
|
-
const workspace_service_1 = require("./workspace-service");
|
|
31
|
-
const filesystem_utils_1 = require("@theia/filesystem/lib/common/filesystem-utils");
|
|
32
|
-
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
33
|
-
let WorkspaceDuplicateHandler = class WorkspaceDuplicateHandler {
|
|
34
|
-
/**
|
|
35
|
-
* Determine if the command is visible.
|
|
36
|
-
*
|
|
37
|
-
* @param uris URIs of selected resources.
|
|
38
|
-
* @returns `true` if the command is visible.
|
|
39
|
-
*/
|
|
40
|
-
isVisible(uris) {
|
|
41
|
-
return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Determine if the command is enabled.
|
|
45
|
-
*
|
|
46
|
-
* @param uris URIs of selected resources.
|
|
47
|
-
* @returns `true` if the command is enabled.
|
|
48
|
-
*/
|
|
49
|
-
isEnabled(uris) {
|
|
50
|
-
return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Execute the command.
|
|
54
|
-
*
|
|
55
|
-
* @param uris URIs of selected resources.
|
|
56
|
-
*/
|
|
57
|
-
async execute(uris) {
|
|
58
|
-
await Promise.all(uris.map(async (uri) => {
|
|
59
|
-
try {
|
|
60
|
-
const parent = await this.fileService.resolve(uri.parent);
|
|
61
|
-
const targetFileStat = await this.fileService.resolve(uri);
|
|
62
|
-
const target = filesystem_utils_1.FileSystemUtils.generateUniqueResourceURI(parent, uri, targetFileStat.isDirectory, 'copy');
|
|
63
|
-
await this.fileService.copy(uri, target);
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
console.error(e);
|
|
67
|
-
}
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, inversify_1.inject)(file_service_1.FileService),
|
|
73
|
-
__metadata("design:type", file_service_1.FileService)
|
|
74
|
-
], WorkspaceDuplicateHandler.prototype, "fileService", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, inversify_1.inject)(workspace_utils_1.WorkspaceUtils),
|
|
77
|
-
__metadata("design:type", workspace_utils_1.WorkspaceUtils)
|
|
78
|
-
], WorkspaceDuplicateHandler.prototype, "workspaceUtils", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
81
|
-
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
82
|
-
], WorkspaceDuplicateHandler.prototype, "workspaceService", void 0);
|
|
83
|
-
WorkspaceDuplicateHandler = __decorate([
|
|
84
|
-
(0, inversify_1.injectable)()
|
|
85
|
-
], WorkspaceDuplicateHandler);
|
|
86
|
-
exports.WorkspaceDuplicateHandler = WorkspaceDuplicateHandler;
|
|
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.WorkspaceDuplicateHandler = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const workspace_utils_1 = require("./workspace-utils");
|
|
30
|
+
const workspace_service_1 = require("./workspace-service");
|
|
31
|
+
const filesystem_utils_1 = require("@theia/filesystem/lib/common/filesystem-utils");
|
|
32
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
33
|
+
let WorkspaceDuplicateHandler = class WorkspaceDuplicateHandler {
|
|
34
|
+
/**
|
|
35
|
+
* Determine if the command is visible.
|
|
36
|
+
*
|
|
37
|
+
* @param uris URIs of selected resources.
|
|
38
|
+
* @returns `true` if the command is visible.
|
|
39
|
+
*/
|
|
40
|
+
isVisible(uris) {
|
|
41
|
+
return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Determine if the command is enabled.
|
|
45
|
+
*
|
|
46
|
+
* @param uris URIs of selected resources.
|
|
47
|
+
* @returns `true` if the command is enabled.
|
|
48
|
+
*/
|
|
49
|
+
isEnabled(uris) {
|
|
50
|
+
return !!uris.length && !this.workspaceUtils.containsRootDirectory(uris);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Execute the command.
|
|
54
|
+
*
|
|
55
|
+
* @param uris URIs of selected resources.
|
|
56
|
+
*/
|
|
57
|
+
async execute(uris) {
|
|
58
|
+
await Promise.all(uris.map(async (uri) => {
|
|
59
|
+
try {
|
|
60
|
+
const parent = await this.fileService.resolve(uri.parent);
|
|
61
|
+
const targetFileStat = await this.fileService.resolve(uri);
|
|
62
|
+
const target = filesystem_utils_1.FileSystemUtils.generateUniqueResourceURI(parent, uri, targetFileStat.isDirectory, 'copy');
|
|
63
|
+
await this.fileService.copy(uri, target);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
console.error(e);
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, inversify_1.inject)(file_service_1.FileService),
|
|
73
|
+
__metadata("design:type", file_service_1.FileService)
|
|
74
|
+
], WorkspaceDuplicateHandler.prototype, "fileService", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, inversify_1.inject)(workspace_utils_1.WorkspaceUtils),
|
|
77
|
+
__metadata("design:type", workspace_utils_1.WorkspaceUtils)
|
|
78
|
+
], WorkspaceDuplicateHandler.prototype, "workspaceUtils", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
81
|
+
__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
82
|
+
], WorkspaceDuplicateHandler.prototype, "workspaceService", void 0);
|
|
83
|
+
WorkspaceDuplicateHandler = __decorate([
|
|
84
|
+
(0, inversify_1.injectable)()
|
|
85
|
+
], WorkspaceDuplicateHandler);
|
|
86
|
+
exports.WorkspaceDuplicateHandler = WorkspaceDuplicateHandler;
|
|
87
87
|
//# sourceMappingURL=workspace-duplicate-handler.js.map
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, MessageService, MaybeArray } from '@theia/core/lib/common';
|
|
2
|
-
import { OpenerService, KeybindingRegistry, KeybindingContribution, FrontendApplicationContribution, OnWillStopAction, Navigatable, SaveableSource, Widget } from '@theia/core/lib/browser';
|
|
3
|
-
import { FileDialogService, FileDialogTreeFilters } from '@theia/filesystem/lib/browser';
|
|
4
|
-
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
5
|
-
import { WorkspaceService } from './workspace-service';
|
|
6
|
-
import { WorkspaceFileService } from '../common';
|
|
7
|
-
import { QuickOpenWorkspace } from './quick-open-workspace';
|
|
8
|
-
import URI from '@theia/core/lib/common/uri';
|
|
9
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
10
|
-
import { EncodingRegistry } from '@theia/core/lib/browser/encoding-registry';
|
|
11
|
-
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
12
|
-
import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
|
|
13
|
-
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
14
|
-
import { FilesystemSaveResourceService } from '@theia/filesystem/lib/browser/filesystem-save-resource-service';
|
|
15
|
-
export declare enum WorkspaceStates {
|
|
16
|
-
/**
|
|
17
|
-
* The state is `empty` when no workspace is opened.
|
|
18
|
-
*/
|
|
19
|
-
empty = "empty",
|
|
20
|
-
/**
|
|
21
|
-
* The state is `workspace` when a workspace is opened.
|
|
22
|
-
*/
|
|
23
|
-
workspace = "workspace",
|
|
24
|
-
/**
|
|
25
|
-
* The state is `folder` when a folder is opened. (1 folder)
|
|
26
|
-
*/
|
|
27
|
-
folder = "folder"
|
|
28
|
-
}
|
|
29
|
-
export declare type WorkspaceState = keyof typeof WorkspaceStates;
|
|
30
|
-
export declare type WorkbenchState = keyof typeof WorkspaceStates;
|
|
31
|
-
/** Create the workspace section after open {@link CommonMenus.FILE_OPEN}. */
|
|
32
|
-
export declare const FILE_WORKSPACE: string[];
|
|
33
|
-
export declare class WorkspaceFrontendContribution implements CommandContribution, KeybindingContribution, MenuContribution, FrontendApplicationContribution {
|
|
34
|
-
protected readonly messageService: MessageService;
|
|
35
|
-
protected readonly fileService: FileService;
|
|
36
|
-
protected readonly openerService: OpenerService;
|
|
37
|
-
protected readonly workspaceService: WorkspaceService;
|
|
38
|
-
protected readonly quickOpenWorkspace: QuickOpenWorkspace;
|
|
39
|
-
protected readonly fileDialogService: FileDialogService;
|
|
40
|
-
protected readonly contextKeyService: ContextKeyService;
|
|
41
|
-
protected readonly encodingRegistry: EncodingRegistry;
|
|
42
|
-
protected readonly preferenceConfigurations: PreferenceConfigurations;
|
|
43
|
-
protected readonly saveService: FilesystemSaveResourceService;
|
|
44
|
-
protected readonly workspaceFileService: WorkspaceFileService;
|
|
45
|
-
configure(): void;
|
|
46
|
-
protected readonly toDisposeOnUpdateEncodingOverrides: DisposableCollection;
|
|
47
|
-
protected updateEncodingOverrides(): void;
|
|
48
|
-
protected updateStyles(): void;
|
|
49
|
-
registerCommands(commands: CommandRegistry): void;
|
|
50
|
-
registerMenus(menus: MenuModelRegistry): void;
|
|
51
|
-
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
52
|
-
/**
|
|
53
|
-
* This is the generic `Open` method. Opens files and directories too. Resolves to the opened URI.
|
|
54
|
-
* Except when you are on either Windows or Linux `AND` running in electron. If so, it opens a file.
|
|
55
|
-
*/
|
|
56
|
-
protected doOpen(): Promise<URI[] | undefined>;
|
|
57
|
-
/**
|
|
58
|
-
* Opens a set of files after prompting the `Open File` dialog. Resolves to `undefined`, if
|
|
59
|
-
* - the workspace root is not set,
|
|
60
|
-
* - the file to open does not exist, or
|
|
61
|
-
* - it was not a file, but a directory.
|
|
62
|
-
*
|
|
63
|
-
* Otherwise, resolves to the set of URIs of the files.
|
|
64
|
-
*/
|
|
65
|
-
protected doOpenFile(): Promise<URI[] | undefined>;
|
|
66
|
-
/**
|
|
67
|
-
* Opens one or more folders after prompting the `Open Folder` dialog. Resolves to `undefined`, if
|
|
68
|
-
* - the user's selection is empty or contains only files.
|
|
69
|
-
* - the new workspace is equal to the old workspace.
|
|
70
|
-
*
|
|
71
|
-
* Otherwise, resolves to the URI of the new workspace:
|
|
72
|
-
* - a single folder if a single folder was selected.
|
|
73
|
-
* - a new, untitled workspace file if multiple folders were selected.
|
|
74
|
-
*/
|
|
75
|
-
protected doOpenFolder(): Promise<URI | undefined>;
|
|
76
|
-
protected getOpenableWorkspaceUri(uris: MaybeArray<URI>): Promise<URI | undefined>;
|
|
77
|
-
protected createMultiRootWorkspace(roots: FileStat[]): Promise<URI>;
|
|
78
|
-
/**
|
|
79
|
-
* Opens a workspace after raising the `Open Workspace` dialog. Resolves to the URI of the recently opened workspace,
|
|
80
|
-
* if it was successful. Otherwise, resolves to `undefined`.
|
|
81
|
-
*/
|
|
82
|
-
protected doOpenWorkspace(): Promise<URI | undefined>;
|
|
83
|
-
protected closeWorkspace(): Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* @returns whether the file was successfully saved.
|
|
86
|
-
*/
|
|
87
|
-
protected saveWorkspaceAs(): Promise<boolean>;
|
|
88
|
-
canBeSavedAs(widget: Widget | undefined): widget is Widget & SaveableSource & Navigatable;
|
|
89
|
-
saveAs(widget: Widget & SaveableSource & Navigatable): Promise<void>;
|
|
90
|
-
protected updateWorkspaceStateKey(): WorkspaceState;
|
|
91
|
-
protected updateWorkbenchStateKey(): WorkbenchState;
|
|
92
|
-
protected doUpdateState(): WorkspaceState | WorkbenchState;
|
|
93
|
-
protected getWorkspaceDialogFileFilters(): FileDialogTreeFilters;
|
|
94
|
-
private isElectron;
|
|
95
|
-
/**
|
|
96
|
-
* Get the current workspace URI.
|
|
97
|
-
*
|
|
98
|
-
* @returns the current workspace URI.
|
|
99
|
-
*/
|
|
100
|
-
private getCurrentWorkspaceUri;
|
|
101
|
-
onWillStop(): OnWillStopAction<boolean> | undefined;
|
|
102
|
-
}
|
|
103
|
-
export declare namespace WorkspaceFrontendContribution {
|
|
104
|
-
/**
|
|
105
|
-
* File filter for all Theia and VS Code workspace file types.
|
|
106
|
-
*
|
|
107
|
-
* @deprecated Since 1.39.0 Use `WorkspaceFrontendContribution#getWorkspaceDialogFileFilters` instead.
|
|
108
|
-
*/
|
|
109
|
-
const DEFAULT_FILE_FILTER: FileDialogTreeFilters;
|
|
110
|
-
}
|
|
1
|
+
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, MessageService, MaybeArray } from '@theia/core/lib/common';
|
|
2
|
+
import { OpenerService, KeybindingRegistry, KeybindingContribution, FrontendApplicationContribution, OnWillStopAction, Navigatable, SaveableSource, Widget } from '@theia/core/lib/browser';
|
|
3
|
+
import { FileDialogService, FileDialogTreeFilters } from '@theia/filesystem/lib/browser';
|
|
4
|
+
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
5
|
+
import { WorkspaceService } from './workspace-service';
|
|
6
|
+
import { WorkspaceFileService } from '../common';
|
|
7
|
+
import { QuickOpenWorkspace } from './quick-open-workspace';
|
|
8
|
+
import URI from '@theia/core/lib/common/uri';
|
|
9
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
10
|
+
import { EncodingRegistry } from '@theia/core/lib/browser/encoding-registry';
|
|
11
|
+
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
12
|
+
import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
|
|
13
|
+
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
14
|
+
import { FilesystemSaveResourceService } from '@theia/filesystem/lib/browser/filesystem-save-resource-service';
|
|
15
|
+
export declare enum WorkspaceStates {
|
|
16
|
+
/**
|
|
17
|
+
* The state is `empty` when no workspace is opened.
|
|
18
|
+
*/
|
|
19
|
+
empty = "empty",
|
|
20
|
+
/**
|
|
21
|
+
* The state is `workspace` when a workspace is opened.
|
|
22
|
+
*/
|
|
23
|
+
workspace = "workspace",
|
|
24
|
+
/**
|
|
25
|
+
* The state is `folder` when a folder is opened. (1 folder)
|
|
26
|
+
*/
|
|
27
|
+
folder = "folder"
|
|
28
|
+
}
|
|
29
|
+
export declare type WorkspaceState = keyof typeof WorkspaceStates;
|
|
30
|
+
export declare type WorkbenchState = keyof typeof WorkspaceStates;
|
|
31
|
+
/** Create the workspace section after open {@link CommonMenus.FILE_OPEN}. */
|
|
32
|
+
export declare const FILE_WORKSPACE: string[];
|
|
33
|
+
export declare class WorkspaceFrontendContribution implements CommandContribution, KeybindingContribution, MenuContribution, FrontendApplicationContribution {
|
|
34
|
+
protected readonly messageService: MessageService;
|
|
35
|
+
protected readonly fileService: FileService;
|
|
36
|
+
protected readonly openerService: OpenerService;
|
|
37
|
+
protected readonly workspaceService: WorkspaceService;
|
|
38
|
+
protected readonly quickOpenWorkspace: QuickOpenWorkspace;
|
|
39
|
+
protected readonly fileDialogService: FileDialogService;
|
|
40
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
41
|
+
protected readonly encodingRegistry: EncodingRegistry;
|
|
42
|
+
protected readonly preferenceConfigurations: PreferenceConfigurations;
|
|
43
|
+
protected readonly saveService: FilesystemSaveResourceService;
|
|
44
|
+
protected readonly workspaceFileService: WorkspaceFileService;
|
|
45
|
+
configure(): void;
|
|
46
|
+
protected readonly toDisposeOnUpdateEncodingOverrides: DisposableCollection;
|
|
47
|
+
protected updateEncodingOverrides(): void;
|
|
48
|
+
protected updateStyles(): void;
|
|
49
|
+
registerCommands(commands: CommandRegistry): void;
|
|
50
|
+
registerMenus(menus: MenuModelRegistry): void;
|
|
51
|
+
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
52
|
+
/**
|
|
53
|
+
* This is the generic `Open` method. Opens files and directories too. Resolves to the opened URI.
|
|
54
|
+
* Except when you are on either Windows or Linux `AND` running in electron. If so, it opens a file.
|
|
55
|
+
*/
|
|
56
|
+
protected doOpen(): Promise<URI[] | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Opens a set of files after prompting the `Open File` dialog. Resolves to `undefined`, if
|
|
59
|
+
* - the workspace root is not set,
|
|
60
|
+
* - the file to open does not exist, or
|
|
61
|
+
* - it was not a file, but a directory.
|
|
62
|
+
*
|
|
63
|
+
* Otherwise, resolves to the set of URIs of the files.
|
|
64
|
+
*/
|
|
65
|
+
protected doOpenFile(): Promise<URI[] | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Opens one or more folders after prompting the `Open Folder` dialog. Resolves to `undefined`, if
|
|
68
|
+
* - the user's selection is empty or contains only files.
|
|
69
|
+
* - the new workspace is equal to the old workspace.
|
|
70
|
+
*
|
|
71
|
+
* Otherwise, resolves to the URI of the new workspace:
|
|
72
|
+
* - a single folder if a single folder was selected.
|
|
73
|
+
* - a new, untitled workspace file if multiple folders were selected.
|
|
74
|
+
*/
|
|
75
|
+
protected doOpenFolder(): Promise<URI | undefined>;
|
|
76
|
+
protected getOpenableWorkspaceUri(uris: MaybeArray<URI>): Promise<URI | undefined>;
|
|
77
|
+
protected createMultiRootWorkspace(roots: FileStat[]): Promise<URI>;
|
|
78
|
+
/**
|
|
79
|
+
* Opens a workspace after raising the `Open Workspace` dialog. Resolves to the URI of the recently opened workspace,
|
|
80
|
+
* if it was successful. Otherwise, resolves to `undefined`.
|
|
81
|
+
*/
|
|
82
|
+
protected doOpenWorkspace(): Promise<URI | undefined>;
|
|
83
|
+
protected closeWorkspace(): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* @returns whether the file was successfully saved.
|
|
86
|
+
*/
|
|
87
|
+
protected saveWorkspaceAs(): Promise<boolean>;
|
|
88
|
+
canBeSavedAs(widget: Widget | undefined): widget is Widget & SaveableSource & Navigatable;
|
|
89
|
+
saveAs(widget: Widget & SaveableSource & Navigatable): Promise<void>;
|
|
90
|
+
protected updateWorkspaceStateKey(): WorkspaceState;
|
|
91
|
+
protected updateWorkbenchStateKey(): WorkbenchState;
|
|
92
|
+
protected doUpdateState(): WorkspaceState | WorkbenchState;
|
|
93
|
+
protected getWorkspaceDialogFileFilters(): FileDialogTreeFilters;
|
|
94
|
+
private isElectron;
|
|
95
|
+
/**
|
|
96
|
+
* Get the current workspace URI.
|
|
97
|
+
*
|
|
98
|
+
* @returns the current workspace URI.
|
|
99
|
+
*/
|
|
100
|
+
private getCurrentWorkspaceUri;
|
|
101
|
+
onWillStop(): OnWillStopAction<boolean> | undefined;
|
|
102
|
+
}
|
|
103
|
+
export declare namespace WorkspaceFrontendContribution {
|
|
104
|
+
/**
|
|
105
|
+
* File filter for all Theia and VS Code workspace file types.
|
|
106
|
+
*
|
|
107
|
+
* @deprecated Since 1.39.0 Use `WorkspaceFrontendContribution#getWorkspaceDialogFileFilters` instead.
|
|
108
|
+
*/
|
|
109
|
+
const DEFAULT_FILE_FILTER: FileDialogTreeFilters;
|
|
110
|
+
}
|
|
111
111
|
//# sourceMappingURL=workspace-frontend-contribution.d.ts.map
|