@theia/workspace 1.34.1 → 1.34.3

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 (105) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/browser/diff-service.d.ts +10 -10
  4. package/lib/browser/diff-service.js +85 -85
  5. package/lib/browser/index.d.ts +6 -6
  6. package/lib/browser/index.js +33 -33
  7. package/lib/browser/quick-open-workspace.d.ts +25 -25
  8. package/lib/browser/quick-open-workspace.js +137 -137
  9. package/lib/browser/untitled-workspace-exit-dialog.d.ts +19 -19
  10. package/lib/browser/untitled-workspace-exit-dialog.js +74 -74
  11. package/lib/browser/workspace-breadcrumbs-contribution.d.ts +10 -10
  12. package/lib/browser/workspace-breadcrumbs-contribution.js +66 -66
  13. package/lib/browser/workspace-commands.d.ts +117 -117
  14. package/lib/browser/workspace-commands.js +593 -593
  15. package/lib/browser/workspace-commands.spec.d.ts +1 -1
  16. package/lib/browser/workspace-commands.spec.js +127 -127
  17. package/lib/browser/workspace-compare-handler.d.ts +26 -26
  18. package/lib/browser/workspace-compare-handler.js +66 -66
  19. package/lib/browser/workspace-delete-handler.d.ts +75 -75
  20. package/lib/browser/workspace-delete-handler.js +214 -214
  21. package/lib/browser/workspace-duplicate-handler.d.ts +30 -30
  22. package/lib/browser/workspace-duplicate-handler.js +86 -86
  23. package/lib/browser/workspace-frontend-contribution.d.ts +135 -135
  24. package/lib/browser/workspace-frontend-contribution.js +568 -568
  25. package/lib/browser/workspace-frontend-contribution.spec.d.ts +1 -1
  26. package/lib/browser/workspace-frontend-contribution.spec.js +53 -53
  27. package/lib/browser/workspace-frontend-module.d.ts +3 -3
  28. package/lib/browser/workspace-frontend-module.js +88 -88
  29. package/lib/browser/workspace-input-dialog.d.ts +19 -19
  30. package/lib/browser/workspace-input-dialog.js +73 -73
  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 +32 -32
  34. package/lib/browser/workspace-schema-updater.js +148 -148
  35. package/lib/browser/workspace-service.d.ts +182 -182
  36. package/lib/browser/workspace-service.js +729 -729
  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 +26 -26
  42. package/lib/browser/workspace-trust-service.js +149 -149
  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/common/index.d.ts +2 -2
  56. package/lib/common/index.js +29 -29
  57. package/lib/common/test/mock-workspace-server.d.ts +7 -7
  58. package/lib/common/test/mock-workspace-server.js +35 -35
  59. package/lib/common/utils.d.ts +21 -21
  60. package/lib/common/utils.js +73 -73
  61. package/lib/common/workspace-protocol.d.ts +26 -26
  62. package/lib/common/workspace-protocol.js +23 -23
  63. package/lib/node/default-workspace-server.d.ts +64 -64
  64. package/lib/node/default-workspace-server.js +248 -248
  65. package/lib/node/default-workspace-server.spec.d.ts +1 -1
  66. package/lib/node/default-workspace-server.spec.js +84 -84
  67. package/lib/node/index.d.ts +2 -2
  68. package/lib/node/index.js +29 -29
  69. package/lib/node/workspace-backend-module.d.ts +3 -3
  70. package/lib/node/workspace-backend-module.js +32 -32
  71. package/package.json +6 -6
  72. package/src/browser/diff-service.ts +62 -62
  73. package/src/browser/index.ts +22 -22
  74. package/src/browser/quick-open-workspace.ts +112 -112
  75. package/src/browser/untitled-workspace-exit-dialog.ts +70 -70
  76. package/src/browser/workspace-breadcrumbs-contribution.ts +56 -56
  77. package/src/browser/workspace-commands.spec.ts +153 -153
  78. package/src/browser/workspace-commands.ts +586 -586
  79. package/src/browser/workspace-compare-handler.ts +56 -56
  80. package/src/browser/workspace-delete-handler.ts +212 -212
  81. package/src/browser/workspace-duplicate-handler.ts +75 -75
  82. package/src/browser/workspace-frontend-contribution.spec.ts +63 -63
  83. package/src/browser/workspace-frontend-contribution.ts +558 -558
  84. package/src/browser/workspace-frontend-module.ts +115 -115
  85. package/src/browser/workspace-input-dialog.ts +60 -60
  86. package/src/browser/workspace-preferences.ts +58 -58
  87. package/src/browser/workspace-schema-updater.ts +148 -148
  88. package/src/browser/workspace-service.ts +772 -772
  89. package/src/browser/workspace-storage-service.ts +67 -67
  90. package/src/browser/workspace-trust-preferences.ts +76 -76
  91. package/src/browser/workspace-trust-service.ts +143 -143
  92. package/src/browser/workspace-uri-contribution.spec.ts +191 -191
  93. package/src/browser/workspace-uri-contribution.ts +97 -97
  94. package/src/browser/workspace-user-working-directory-provider.ts +48 -48
  95. package/src/browser/workspace-utils.ts +45 -45
  96. package/src/browser/workspace-variable-contribution.ts +222 -222
  97. package/src/browser/workspace-window-title-updater.ts +45 -45
  98. package/src/common/index.ts +18 -18
  99. package/src/common/test/mock-workspace-server.ts +29 -29
  100. package/src/common/utils.ts +69 -69
  101. package/src/common/workspace-protocol.ts +47 -47
  102. package/src/node/default-workspace-server.spec.ts +99 -99
  103. package/src/node/default-workspace-server.ts +242 -242
  104. package/src/node/index.ts +18 -18
  105. package/src/node/workspace-backend-module.ts +37 -37
@@ -1,118 +1,118 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { SelectionService } from '@theia/core/lib/common/selection-service';
3
- import { Command, CommandContribution, CommandRegistry } from '@theia/core/lib/common/command';
4
- import { MenuContribution, MenuModelRegistry } from '@theia/core/lib/common/menu';
5
- import { FileDialogService } from '@theia/filesystem/lib/browser';
6
- import { OpenerService, OpenHandler, FrontendApplication, LabelProvider } from '@theia/core/lib/browser';
7
- import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
8
- import { WorkspaceService } from './workspace-service';
9
- import { MessageService } from '@theia/core/lib/common/message-service';
10
- import { WorkspacePreferences } from './workspace-preferences';
11
- import { WorkspaceDeleteHandler } from './workspace-delete-handler';
12
- import { WorkspaceDuplicateHandler } from './workspace-duplicate-handler';
13
- import { WorkspaceCompareHandler } from './workspace-compare-handler';
14
- import { Event } from '@theia/core/lib/common';
15
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
16
- import { FileStat } from '@theia/filesystem/lib/common/files';
17
- import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
18
- export declare namespace WorkspaceCommands {
19
- const OPEN: Command & {
20
- dialogLabel: string;
21
- };
22
- const OPEN_FILE: Command & {
23
- dialogLabel: string;
24
- };
25
- const OPEN_FOLDER: Command & {
26
- dialogLabel: string;
27
- };
28
- const OPEN_WORKSPACE: Command & {
29
- dialogLabel: string;
30
- };
31
- const OPEN_RECENT_WORKSPACE: Command;
32
- const CLOSE: Command;
33
- const NEW_FILE: Command;
34
- const NEW_FOLDER: Command;
35
- const FILE_OPEN_WITH: (opener: OpenHandler) => Command;
36
- const FILE_RENAME: Command;
37
- const FILE_DELETE: Command;
38
- const FILE_DUPLICATE: Command;
39
- const FILE_COMPARE: Command;
40
- const ADD_FOLDER: Command;
41
- const REMOVE_FOLDER: Command;
42
- const SAVE_WORKSPACE_AS: Command;
43
- const OPEN_WORKSPACE_FILE: Command;
44
- /** @deprecated @since 1.24.0 Use `CommonCommands.SAVE_AS` instead */
45
- const SAVE_AS: Command;
46
- const COPY_RELATIVE_FILE_PATH: Command;
47
- }
48
- export declare class FileMenuContribution implements MenuContribution {
49
- registerMenus(registry: MenuModelRegistry): void;
50
- }
51
- export declare class EditMenuContribution implements MenuContribution {
52
- registerMenus(registry: MenuModelRegistry): void;
53
- }
54
- export interface DidCreateNewResourceEvent {
55
- uri: URI;
56
- parent: URI;
57
- }
58
- export declare class WorkspaceCommandContribution implements CommandContribution {
59
- protected readonly labelProvider: LabelProvider;
60
- protected readonly fileService: FileService;
61
- protected readonly workspaceService: WorkspaceService;
62
- protected readonly selectionService: SelectionService;
63
- protected readonly openerService: OpenerService;
64
- protected readonly app: FrontendApplication;
65
- protected readonly messageService: MessageService;
66
- protected readonly preferences: WorkspacePreferences;
67
- protected readonly fileDialogService: FileDialogService;
68
- protected readonly deleteHandler: WorkspaceDeleteHandler;
69
- protected readonly duplicateHandler: WorkspaceDuplicateHandler;
70
- protected readonly compareHandler: WorkspaceCompareHandler;
71
- protected readonly clipboardService: ClipboardService;
72
- private readonly onDidCreateNewFileEmitter;
73
- private readonly onDidCreateNewFolderEmitter;
74
- get onDidCreateNewFile(): Event<DidCreateNewResourceEvent>;
75
- get onDidCreateNewFolder(): Event<DidCreateNewResourceEvent>;
76
- protected fireCreateNewFile(uri: DidCreateNewResourceEvent): void;
77
- protected fireCreateNewFolder(uri: DidCreateNewResourceEvent): void;
78
- registerCommands(registry: CommandRegistry): void;
79
- openers: OpenHandler[];
80
- protected registerOpenWith(registry: CommandRegistry): Promise<void>;
81
- protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI>;
82
- protected newMultiUriAwareCommandHandler(handler: UriCommandHandler<URI[]>): UriAwareCommandHandler<URI[]>;
83
- protected newWorkspaceRootUriAwareCommandHandler(handler: UriCommandHandler<URI>): WorkspaceRootUriAwareCommandHandler;
84
- protected validateFileRename(oldName: string, newName: string, parent: FileStat): Promise<string>;
85
- /**
86
- * Returns an error message if the file name is invalid. Otherwise, an empty string.
87
- *
88
- * @param name the simple file name of the file to validate.
89
- * @param parent the parent directory's file stat.
90
- * @param allowNested allow file or folder creation using recursive path
91
- */
92
- protected validateFileName(name: string, parent: FileStat, allowNested?: boolean): Promise<string>;
93
- protected trimFileName(name: string): string;
94
- protected getDirectory(candidate: URI): Promise<FileStat | undefined>;
95
- protected getParent(candidate: URI): Promise<FileStat | undefined>;
96
- protected addFolderToWorkspace(...uris: URI[]): Promise<void>;
97
- protected areWorkspaceRoots(uris: URI[]): boolean;
98
- protected isWorkspaceRoot(uri: URI): boolean;
99
- protected getDefaultFileConfig(): {
100
- fileName: string;
101
- fileExtension: string;
102
- };
103
- /**
104
- * Removes the list of folders from the workspace upon confirmation from the user.
105
- * @param uris the list of folder uris to remove.
106
- */
107
- protected removeFolderFromWorkspace(uris: URI[]): Promise<void>;
108
- saveWorkspaceWithPrompt(registry: CommandRegistry): Promise<void>;
109
- protected areMultipleOpenHandlersPresent(openers: OpenHandler[], uri: URI): boolean;
110
- }
111
- export declare class WorkspaceRootUriAwareCommandHandler extends UriAwareCommandHandler<URI> {
112
- protected readonly workspaceService: WorkspaceService;
113
- constructor(workspaceService: WorkspaceService, selectionService: SelectionService, handler: UriCommandHandler<URI>);
114
- isEnabled(...args: any[]): boolean;
115
- isVisible(...args: any[]): boolean;
116
- protected getUri(...args: any[]): URI | undefined;
117
- }
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { SelectionService } from '@theia/core/lib/common/selection-service';
3
+ import { Command, CommandContribution, CommandRegistry } from '@theia/core/lib/common/command';
4
+ import { MenuContribution, MenuModelRegistry } from '@theia/core/lib/common/menu';
5
+ import { FileDialogService } from '@theia/filesystem/lib/browser';
6
+ import { OpenerService, OpenHandler, FrontendApplication, LabelProvider } from '@theia/core/lib/browser';
7
+ import { UriCommandHandler, UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
8
+ import { WorkspaceService } from './workspace-service';
9
+ import { MessageService } from '@theia/core/lib/common/message-service';
10
+ import { WorkspacePreferences } from './workspace-preferences';
11
+ import { WorkspaceDeleteHandler } from './workspace-delete-handler';
12
+ import { WorkspaceDuplicateHandler } from './workspace-duplicate-handler';
13
+ import { WorkspaceCompareHandler } from './workspace-compare-handler';
14
+ import { Event } from '@theia/core/lib/common';
15
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
16
+ import { FileStat } from '@theia/filesystem/lib/common/files';
17
+ import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
18
+ export declare namespace WorkspaceCommands {
19
+ const OPEN: Command & {
20
+ dialogLabel: string;
21
+ };
22
+ const OPEN_FILE: Command & {
23
+ dialogLabel: string;
24
+ };
25
+ const OPEN_FOLDER: Command & {
26
+ dialogLabel: string;
27
+ };
28
+ const OPEN_WORKSPACE: Command & {
29
+ dialogLabel: string;
30
+ };
31
+ const OPEN_RECENT_WORKSPACE: Command;
32
+ const CLOSE: Command;
33
+ const NEW_FILE: Command;
34
+ const NEW_FOLDER: Command;
35
+ const FILE_OPEN_WITH: (opener: OpenHandler) => Command;
36
+ const FILE_RENAME: Command;
37
+ const FILE_DELETE: Command;
38
+ const FILE_DUPLICATE: Command;
39
+ const FILE_COMPARE: Command;
40
+ const ADD_FOLDER: Command;
41
+ const REMOVE_FOLDER: Command;
42
+ const SAVE_WORKSPACE_AS: Command;
43
+ const OPEN_WORKSPACE_FILE: Command;
44
+ /** @deprecated @since 1.24.0 Use `CommonCommands.SAVE_AS` instead */
45
+ const SAVE_AS: Command;
46
+ const COPY_RELATIVE_FILE_PATH: Command;
47
+ }
48
+ export declare class FileMenuContribution implements MenuContribution {
49
+ registerMenus(registry: MenuModelRegistry): void;
50
+ }
51
+ export declare class EditMenuContribution implements MenuContribution {
52
+ registerMenus(registry: MenuModelRegistry): void;
53
+ }
54
+ export interface DidCreateNewResourceEvent {
55
+ uri: URI;
56
+ parent: URI;
57
+ }
58
+ export declare class WorkspaceCommandContribution implements CommandContribution {
59
+ protected readonly labelProvider: LabelProvider;
60
+ protected readonly fileService: FileService;
61
+ protected readonly workspaceService: WorkspaceService;
62
+ protected readonly selectionService: SelectionService;
63
+ protected readonly openerService: OpenerService;
64
+ protected readonly app: FrontendApplication;
65
+ protected readonly messageService: MessageService;
66
+ protected readonly preferences: WorkspacePreferences;
67
+ protected readonly fileDialogService: FileDialogService;
68
+ protected readonly deleteHandler: WorkspaceDeleteHandler;
69
+ protected readonly duplicateHandler: WorkspaceDuplicateHandler;
70
+ protected readonly compareHandler: WorkspaceCompareHandler;
71
+ protected readonly clipboardService: ClipboardService;
72
+ private readonly onDidCreateNewFileEmitter;
73
+ private readonly onDidCreateNewFolderEmitter;
74
+ get onDidCreateNewFile(): Event<DidCreateNewResourceEvent>;
75
+ get onDidCreateNewFolder(): Event<DidCreateNewResourceEvent>;
76
+ protected fireCreateNewFile(uri: DidCreateNewResourceEvent): void;
77
+ protected fireCreateNewFolder(uri: DidCreateNewResourceEvent): void;
78
+ registerCommands(registry: CommandRegistry): void;
79
+ openers: OpenHandler[];
80
+ protected registerOpenWith(registry: CommandRegistry): Promise<void>;
81
+ protected newUriAwareCommandHandler(handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI>;
82
+ protected newMultiUriAwareCommandHandler(handler: UriCommandHandler<URI[]>): UriAwareCommandHandler<URI[]>;
83
+ protected newWorkspaceRootUriAwareCommandHandler(handler: UriCommandHandler<URI>): WorkspaceRootUriAwareCommandHandler;
84
+ protected validateFileRename(oldName: string, newName: string, parent: FileStat): Promise<string>;
85
+ /**
86
+ * Returns an error message if the file name is invalid. Otherwise, an empty string.
87
+ *
88
+ * @param name the simple file name of the file to validate.
89
+ * @param parent the parent directory's file stat.
90
+ * @param allowNested allow file or folder creation using recursive path
91
+ */
92
+ protected validateFileName(name: string, parent: FileStat, allowNested?: boolean): Promise<string>;
93
+ protected trimFileName(name: string): string;
94
+ protected getDirectory(candidate: URI): Promise<FileStat | undefined>;
95
+ protected getParent(candidate: URI): Promise<FileStat | undefined>;
96
+ protected addFolderToWorkspace(...uris: URI[]): Promise<void>;
97
+ protected areWorkspaceRoots(uris: URI[]): boolean;
98
+ protected isWorkspaceRoot(uri: URI): boolean;
99
+ protected getDefaultFileConfig(): {
100
+ fileName: string;
101
+ fileExtension: string;
102
+ };
103
+ /**
104
+ * Removes the list of folders from the workspace upon confirmation from the user.
105
+ * @param uris the list of folder uris to remove.
106
+ */
107
+ protected removeFolderFromWorkspace(uris: URI[]): Promise<void>;
108
+ saveWorkspaceWithPrompt(registry: CommandRegistry): Promise<void>;
109
+ protected areMultipleOpenHandlersPresent(openers: OpenHandler[], uri: URI): boolean;
110
+ }
111
+ export declare class WorkspaceRootUriAwareCommandHandler extends UriAwareCommandHandler<URI> {
112
+ protected readonly workspaceService: WorkspaceService;
113
+ constructor(workspaceService: WorkspaceService, selectionService: SelectionService, handler: UriCommandHandler<URI>);
114
+ isEnabled(...args: any[]): boolean;
115
+ isVisible(...args: any[]): boolean;
116
+ protected getUri(...args: any[]): URI | undefined;
117
+ }
118
118
  //# sourceMappingURL=workspace-commands.d.ts.map