@theia/plugin-ext 1.40.1 → 1.41.0
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/lib/common/collections.d.ts +4 -0
- package/lib/common/collections.d.ts.map +1 -1
- package/lib/common/collections.js +17 -1
- package/lib/common/collections.js.map +1 -1
- package/lib/common/errors.d.ts +14 -0
- package/lib/common/errors.d.ts.map +1 -1
- package/lib/common/errors.js +17 -1
- package/lib/common/errors.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +286 -6
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +20 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +27 -5
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +5 -2
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +21 -12
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/hosted/node/plugin-reader.d.ts +1 -1
- package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-reader.js +1 -1
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.d.ts +1 -1
- package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +5 -5
- package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +6 -6
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +54 -41
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +1 -0
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +6 -4
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +18 -0
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +6 -3
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +50 -0
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +189 -0
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -0
- package/lib/main/browser/notebooks/notebook-documents-main.d.ts +22 -0
- package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-documents-main.js +133 -0
- package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -0
- package/lib/main/browser/notebooks/notebook-dto.d.ts +15 -0
- package/lib/main/browser/notebooks/notebook-dto.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-dto.js +138 -0
- package/lib/main/browser/notebooks/notebook-dto.js.map +1 -0
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts +20 -0
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-editors-main.js +58 -0
- package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -0
- package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +42 -0
- package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-kernels-main.js +230 -0
- package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -0
- package/lib/main/browser/notebooks/notebook-renderers-main.d.ts +12 -0
- package/lib/main/browser/notebooks/notebook-renderers-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebook-renderers-main.js +39 -0
- package/lib/main/browser/notebooks/notebook-renderers-main.js.map +1 -0
- package/lib/main/browser/notebooks/notebooks-main.d.ts +20 -0
- package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -0
- package/lib/main/browser/notebooks/notebooks-main.js +103 -0
- package/lib/main/browser/notebooks/notebooks-main.js.map +1 -0
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +35 -0
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -0
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +204 -0
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -0
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +13 -0
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -0
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js +375 -0
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -0
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +52 -0
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -0
- package/{src/typings/index.d.ts → lib/main/browser/notebooks/renderers/webview-communication.js} +8 -11
- package/lib/main/browser/notebooks/renderers/webview-communication.js.map +1 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts +3 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +31 -3
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.js +3 -2
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +6 -0
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +2 -1
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/tasks-main.js +2 -2
- package/lib/main/browser/tasks-main.js.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +2 -2
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/terminal-main.js +4 -4
- package/lib/main/browser/terminal-main.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -1
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +32 -1
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/view/tree-views-main.d.ts +2 -1
- package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
- package/lib/main/browser/view/tree-views-main.js +10 -0
- package/lib/main/browser/view/tree-views-main.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +1 -0
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +5 -0
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/node/errors.spec.d.ts +2 -0
- package/lib/main/node/errors.spec.d.ts.map +1 -0
- package/lib/main/node/errors.spec.js +36 -0
- package/lib/main/node/errors.spec.js.map +1 -0
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +5 -2
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +14 -8
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +13 -5
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.d.ts.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +4 -9
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +8 -8
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-entry-impl.d.ts +2 -2
- package/lib/main/node/plugin-deployer-entry-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-entry-impl.js +9 -7
- package/lib/main/node/plugin-deployer-entry-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts +2 -2
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +16 -24
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts +2 -2
- package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-github-resolver.d.ts.map +1 -1
- package/lib/main/node/plugin-github-resolver.js +14 -6
- package/lib/main/node/plugin-github-resolver.js.map +1 -1
- package/lib/main/node/plugin-http-resolver.d.ts.map +1 -1
- package/lib/main/node/plugin-http-resolver.js +14 -6
- package/lib/main/node/plugin-http-resolver.js.map +1 -1
- package/lib/main/node/temp-dir-util.d.ts +1 -0
- package/lib/main/node/temp-dir-util.d.ts.map +1 -1
- package/lib/main/node/temp-dir-util.js +12 -3
- package/lib/main/node/temp-dir-util.js.map +1 -1
- package/lib/plugin/editors-and-documents.d.ts +1 -1
- package/lib/plugin/editors-and-documents.d.ts.map +1 -1
- package/lib/plugin/editors-and-documents.js +1 -1
- package/lib/plugin/editors-and-documents.js.map +1 -1
- package/lib/plugin/notebook/notebook-document.d.ts +62 -0
- package/lib/plugin/notebook/notebook-document.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-document.js +373 -0
- package/lib/plugin/notebook/notebook-document.js.map +1 -0
- package/lib/plugin/notebook/notebook-documents.d.ts +17 -0
- package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-documents.js +48 -0
- package/lib/plugin/notebook/notebook-documents.js.map +1 -0
- package/lib/plugin/notebook/notebook-editor.d.ts +21 -0
- package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-editor.js +99 -0
- package/lib/plugin/notebook/notebook-editor.js.map +1 -0
- package/lib/plugin/notebook/notebook-editors.d.ts +14 -0
- package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-editors.js +65 -0
- package/lib/plugin/notebook/notebook-editors.js.map +1 -0
- package/lib/plugin/notebook/notebook-kernels.d.ts +37 -0
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-kernels.js +516 -0
- package/lib/plugin/notebook/notebook-kernels.js.map +1 -0
- package/lib/plugin/notebook/notebook-renderers.d.ts +14 -0
- package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -0
- package/lib/plugin/notebook/notebook-renderers.js +63 -0
- package/lib/plugin/notebook/notebook-renderers.js.map +1 -0
- package/lib/plugin/notebook/notebooks.d.ts +57 -0
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -0
- package/lib/plugin/notebook/notebooks.js +295 -0
- package/lib/plugin/notebook/notebooks.js.map +1 -0
- package/lib/plugin/plugin-context.d.ts +2 -2
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +79 -59
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts +2 -0
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-manager.js +9 -1
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/tasks/task-provider.d.ts +2 -2
- package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
- package/lib/plugin/tasks/task-provider.js +7 -10
- package/lib/plugin/tasks/task-provider.js.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +3 -2
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.js +18 -13
- package/lib/plugin/tasks/tasks.js.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +3 -0
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +11 -1
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +15 -5
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.js +52 -3
- package/lib/plugin/tree/tree-views.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +60 -0
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +372 -13
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +68 -29
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +123 -44
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +31 -29
- package/src/common/collections.ts +17 -0
- package/src/common/errors.ts +26 -0
- package/src/common/plugin-api-rpc.ts +340 -5
- package/src/common/plugin-protocol.ts +23 -5
- package/src/hosted/browser/hosted-plugin.ts +21 -14
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +1 -1
- package/src/hosted/node/plugin-reader.ts +1 -1
- package/src/hosted/node/scanners/grammars-reader.ts +6 -5
- package/src/hosted/node/scanners/scanner-theia.ts +55 -41
- package/src/main/browser/custom-editors/custom-editor-widget.ts +1 -1
- package/src/main/browser/custom-editors/custom-editors-main.ts +1 -1
- package/src/main/browser/editors-and-documents-main.ts +1 -0
- package/src/main/browser/languages-main.ts +7 -4
- package/src/main/browser/main-context.ts +19 -0
- package/src/main/browser/menus/menus-contribution-handler.ts +7 -4
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +238 -0
- package/src/main/browser/notebooks/notebook-documents-main.ts +166 -0
- package/src/main/browser/notebooks/notebook-dto.ts +141 -0
- package/src/main/browser/notebooks/notebook-editors-main.ts +70 -0
- package/src/main/browser/notebooks/notebook-kernels-main.ts +291 -0
- package/src/main/browser/notebooks/notebook-renderers-main.ts +47 -0
- package/src/main/browser/notebooks/notebooks-main.ts +124 -0
- package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +198 -0
- package/src/main/browser/notebooks/renderers/output-webview-internal.ts +476 -0
- package/src/main/browser/notebooks/renderers/webview-communication.ts +79 -0
- package/src/main/browser/plugin-contribution-handler.ts +36 -3
- package/src/main/browser/plugin-ext-frontend-module.ts +7 -3
- package/src/main/browser/plugin-icon-theme-service.ts +6 -0
- package/src/main/browser/plugin-shared-style.ts +2 -1
- package/src/main/browser/tasks-main.ts +4 -4
- package/src/main/browser/terminal-main.ts +5 -5
- package/src/main/browser/view/tree-view-widget.tsx +36 -2
- package/src/main/browser/view/tree-views-main.ts +8 -0
- package/src/main/browser/webview/webview.ts +6 -0
- package/src/main/node/errors.spec.ts +37 -0
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +18 -8
- package/src/main/node/handlers/plugin-theia-file-handler.ts +18 -6
- package/src/main/node/paths/plugin-paths-service.ts +5 -10
- package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +8 -8
- package/src/main/node/plugin-deployer-entry-impl.ts +9 -7
- package/src/main/node/plugin-deployer-impl.ts +20 -28
- package/src/main/node/plugin-deployer-proxy-entry-impl.ts +2 -2
- package/src/main/node/plugin-github-resolver.ts +15 -8
- package/src/main/node/plugin-http-resolver.ts +15 -8
- package/src/main/node/temp-dir-util.ts +11 -2
- package/src/plugin/editors-and-documents.ts +1 -1
- package/src/plugin/notebook/notebook-document.ts +438 -0
- package/src/plugin/notebook/notebook-documents.ts +58 -0
- package/src/plugin/notebook/notebook-editor.ts +116 -0
- package/src/plugin/notebook/notebook-editors.ts +71 -0
- package/src/plugin/notebook/notebook-kernels.ts +616 -0
- package/src/plugin/notebook/notebook-renderers.ts +72 -0
- package/src/plugin/notebook/notebooks.ts +385 -0
- package/src/plugin/plugin-context.ts +77 -70
- package/src/plugin/plugin-manager.ts +9 -1
- package/src/plugin/tasks/task-provider.ts +9 -12
- package/src/plugin/tasks/tasks.ts +18 -13
- package/src/plugin/terminal-ext.ts +13 -1
- package/src/plugin/tree/tree-views.ts +57 -7
- package/src/plugin/type-converters.ts +370 -12
- package/src/plugin/types-impl.ts +162 -58
- package/lib/main/browser/custom-editors/undo-redo-service.d.ts +0 -24
- package/lib/main/browser/custom-editors/undo-redo-service.d.ts.map +0 -1
- package/lib/main/browser/custom-editors/undo-redo-service.js +0 -111
- package/lib/main/browser/custom-editors/undo-redo-service.js.map +0 -1
- package/src/main/browser/custom-editors/undo-redo-service.ts +0 -120
|
@@ -69,6 +69,7 @@ import { LanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/
|
|
|
69
69
|
import { Measurement, Stopwatch } from '@theia/core/lib/common';
|
|
70
70
|
import { Uint8ArrayReadBuffer, Uint8ArrayWriteBuffer } from '@theia/core/lib/common/message-rpc/uint8-array-message-buffer';
|
|
71
71
|
import { BasicChannel } from '@theia/core/lib/common/message-rpc/channel';
|
|
72
|
+
import { NotebookTypeRegistry, NotebookService } from '@theia/notebook/lib/browser';
|
|
72
73
|
|
|
73
74
|
export type PluginHost = 'frontend' | string;
|
|
74
75
|
export type DebugActivationEvent = 'onDebugResolve' | 'onDebugInitialConfigurations' | 'onDebugAdapterProtocolTracker' | 'onDebugDynamicConfigurations';
|
|
@@ -114,6 +115,9 @@ export class HostedPluginSupport {
|
|
|
114
115
|
@inject(WorkspaceService)
|
|
115
116
|
protected readonly workspaceService: WorkspaceService;
|
|
116
117
|
|
|
118
|
+
@inject(NotebookService)
|
|
119
|
+
protected readonly notebookService: NotebookService;
|
|
120
|
+
|
|
117
121
|
@inject(CommandRegistry)
|
|
118
122
|
protected readonly commands: CommandRegistry;
|
|
119
123
|
|
|
@@ -132,6 +136,9 @@ export class HostedPluginSupport {
|
|
|
132
136
|
@inject(FrontendApplicationStateService)
|
|
133
137
|
protected readonly appState: FrontendApplicationStateService;
|
|
134
138
|
|
|
139
|
+
@inject(NotebookTypeRegistry)
|
|
140
|
+
protected readonly notebookTypeRegistry: NotebookTypeRegistry;
|
|
141
|
+
|
|
135
142
|
@inject(PluginViewRegistry)
|
|
136
143
|
protected readonly viewRegistry: PluginViewRegistry;
|
|
137
144
|
|
|
@@ -216,6 +223,7 @@ export class HostedPluginSupport {
|
|
|
216
223
|
this.taskResolverRegistry.onWillProvideTaskResolver(event => this.ensureTaskActivation(event));
|
|
217
224
|
this.fileService.onWillActivateFileSystemProvider(event => this.ensureFileSystemActivation(event));
|
|
218
225
|
this.customEditorRegistry.onWillOpenCustomEditor(event => this.activateByCustomEditor(event));
|
|
226
|
+
this.notebookService.onWillOpenNotebook(async event => this.activateByNotebook(event));
|
|
219
227
|
|
|
220
228
|
this.widgets.onDidCreateWidget(({ factoryId, widget }) => {
|
|
221
229
|
if ((factoryId === WebviewWidget.FACTORY_ID || factoryId === CustomEditorWidget.FACTORY_ID) && widget instanceof WebviewWidget) {
|
|
@@ -304,8 +312,6 @@ export class HostedPluginSupport {
|
|
|
304
312
|
await this.startPlugins(contributionsByHost, toDisconnect);
|
|
305
313
|
|
|
306
314
|
this.deferredDidStart.resolve();
|
|
307
|
-
|
|
308
|
-
this.restoreWebviews();
|
|
309
315
|
}
|
|
310
316
|
|
|
311
317
|
/**
|
|
@@ -623,6 +629,10 @@ export class HostedPluginSupport {
|
|
|
623
629
|
await this.activateByEvent(`onCustomEditor:${viewType}`);
|
|
624
630
|
}
|
|
625
631
|
|
|
632
|
+
async activateByNotebook(viewType: string): Promise<void> {
|
|
633
|
+
await this.activateByEvent(`onNotebook:${viewType}`);
|
|
634
|
+
}
|
|
635
|
+
|
|
626
636
|
activateByFileSystem(event: FileSystemProviderActivationEvent): Promise<void> {
|
|
627
637
|
return this.activateByEvent(`onFileSystem:${event.scheme}`);
|
|
628
638
|
}
|
|
@@ -757,7 +767,7 @@ export class HostedPluginSupport {
|
|
|
757
767
|
return `${plugins} plugin${plugins === 1 ? '' : 's'}`;
|
|
758
768
|
}
|
|
759
769
|
|
|
760
|
-
protected readonly webviewsToRestore = new
|
|
770
|
+
protected readonly webviewsToRestore = new Map<string, WebviewWidget>();
|
|
761
771
|
protected readonly webviewRevivers = new Map<string, (webview: WebviewWidget) => Promise<void>>();
|
|
762
772
|
|
|
763
773
|
registerWebviewReviver(viewType: string, reviver: (webview: WebviewWidget) => Promise<void>): void {
|
|
@@ -765,6 +775,10 @@ export class HostedPluginSupport {
|
|
|
765
775
|
throw new Error(`Reviver for ${viewType} already registered`);
|
|
766
776
|
}
|
|
767
777
|
this.webviewRevivers.set(viewType, reviver);
|
|
778
|
+
|
|
779
|
+
if (this.webviewsToRestore.has(viewType)) {
|
|
780
|
+
this.restoreWebview(this.webviewsToRestore.get(viewType) as WebviewWidget);
|
|
781
|
+
}
|
|
768
782
|
}
|
|
769
783
|
|
|
770
784
|
unregisterWebviewReviver(viewType: string): void {
|
|
@@ -785,21 +799,14 @@ export class HostedPluginSupport {
|
|
|
785
799
|
}
|
|
786
800
|
|
|
787
801
|
protected preserveWebview(webview: WebviewWidget): void {
|
|
788
|
-
if (!this.webviewsToRestore.has(webview)) {
|
|
789
|
-
this.
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
protected restoreWebviews(): void {
|
|
795
|
-
for (const webview of this.webviewsToRestore) {
|
|
796
|
-
this.restoreWebview(webview);
|
|
802
|
+
if (!this.webviewsToRestore.has(webview.viewType)) {
|
|
803
|
+
this.activateByEvent(`onWebviewPanel:${webview.viewType}`);
|
|
804
|
+
this.webviewsToRestore.set(webview.viewType, webview);
|
|
805
|
+
webview.disposed.connect(() => this.webviewsToRestore.delete(webview.viewType));
|
|
797
806
|
}
|
|
798
|
-
this.webviewsToRestore.clear();
|
|
799
807
|
}
|
|
800
808
|
|
|
801
809
|
protected async restoreWebview(webview: WebviewWidget): Promise<void> {
|
|
802
|
-
await this.activateByEvent(`onWebviewPanel:${webview.viewType}`);
|
|
803
810
|
const restore = this.webviewRevivers.get(webview.viewType);
|
|
804
811
|
if (restore) {
|
|
805
812
|
try {
|
|
@@ -173,7 +173,7 @@ export class HostedPluginDeployerHandler implements PluginDeployerHandler {
|
|
|
173
173
|
|
|
174
174
|
const { type } = entry;
|
|
175
175
|
const deployed: DeployedPlugin = { metadata, type };
|
|
176
|
-
deployed.contributes = this.reader.readContribution(manifest);
|
|
176
|
+
deployed.contributes = await this.reader.readContribution(manifest);
|
|
177
177
|
await this.localizationService.deployLocalizations(deployed);
|
|
178
178
|
deployedPlugins.set(id, deployed);
|
|
179
179
|
deployPlugin.debug(`Deployed ${entryPoint} plugin "${id}" from "${metadata.model.entryPoint[entryPoint] || pluginPath}"`);
|
|
@@ -118,7 +118,7 @@ export class HostedPluginReader implements BackendApplicationContribution {
|
|
|
118
118
|
return pluginMetadata;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
readContribution(plugin: PluginPackage): PluginContribution | undefined {
|
|
121
|
+
async readContribution(plugin: PluginPackage): Promise<PluginContribution | undefined> {
|
|
122
122
|
const scanner = this.scanner.getScanner(plugin);
|
|
123
123
|
return scanner.getContribution(plugin);
|
|
124
124
|
}
|
|
@@ -22,10 +22,10 @@ import * as fs from '@theia/core/shared/fs-extra';
|
|
|
22
22
|
@injectable()
|
|
23
23
|
export class GrammarsReader {
|
|
24
24
|
|
|
25
|
-
readGrammars(rawGrammars: PluginPackageGrammarsContribution[], pluginPath: string): GrammarsContribution[] {
|
|
25
|
+
async readGrammars(rawGrammars: PluginPackageGrammarsContribution[], pluginPath: string): Promise<GrammarsContribution[]> {
|
|
26
26
|
const result = new Array<GrammarsContribution>();
|
|
27
27
|
for (const rawGrammar of rawGrammars) {
|
|
28
|
-
const grammar = this.readGrammar(rawGrammar, pluginPath);
|
|
28
|
+
const grammar = await this.readGrammar(rawGrammar, pluginPath);
|
|
29
29
|
if (grammar) {
|
|
30
30
|
result.push(grammar);
|
|
31
31
|
}
|
|
@@ -34,13 +34,14 @@ export class GrammarsReader {
|
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
private readGrammar(rawGrammar: PluginPackageGrammarsContribution, pluginPath: string): GrammarsContribution | undefined {
|
|
37
|
+
private async readGrammar(rawGrammar: PluginPackageGrammarsContribution, pluginPath: string): Promise<GrammarsContribution | undefined> {
|
|
38
38
|
// TODO: validate inputs
|
|
39
39
|
let grammar: string | object;
|
|
40
|
+
|
|
40
41
|
if (rawGrammar.path.endsWith('json')) {
|
|
41
|
-
grammar = fs.
|
|
42
|
+
grammar = await fs.readJSON(path.resolve(pluginPath, rawGrammar.path));
|
|
42
43
|
} else {
|
|
43
|
-
grammar = fs.
|
|
44
|
+
grammar = await fs.readFile(path.resolve(pluginPath, rawGrammar.path), 'utf8');
|
|
44
45
|
}
|
|
45
46
|
return {
|
|
46
47
|
language: rawGrammar.language,
|
|
@@ -62,11 +62,12 @@ import {
|
|
|
62
62
|
PluginIdentifiers,
|
|
63
63
|
TerminalProfile
|
|
64
64
|
} from '../../../common/plugin-protocol';
|
|
65
|
-
import
|
|
65
|
+
import { promises as fs } from 'fs';
|
|
66
66
|
import * as path from 'path';
|
|
67
67
|
import { isObject, isStringArray, RecursivePartial } from '@theia/core/lib/common/types';
|
|
68
68
|
import { GrammarsReader } from './grammars-reader';
|
|
69
69
|
import { CharacterPair } from '../../../common/plugin-api-rpc';
|
|
70
|
+
import { isENOENT } from '../../../common/errors';
|
|
70
71
|
import * as jsoncparser from 'jsonc-parser';
|
|
71
72
|
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
72
73
|
import { deepClone } from '@theia/core/lib/common/objects';
|
|
@@ -144,7 +145,7 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
144
145
|
return undefined;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
|
-
getContribution(rawPlugin: PluginPackage): PluginContribution | undefined {
|
|
148
|
+
async getContribution(rawPlugin: PluginPackage): Promise<PluginContribution | undefined> {
|
|
148
149
|
if (!rawPlugin.contributes && !rawPlugin.activationEvents) {
|
|
149
150
|
return undefined;
|
|
150
151
|
}
|
|
@@ -175,15 +176,6 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
175
176
|
const configurationDefaults = rawPlugin.contributes.configurationDefaults;
|
|
176
177
|
contributions.configurationDefaults = PreferenceSchemaProperties.is(configurationDefaults) ? configurationDefaults : undefined;
|
|
177
178
|
|
|
178
|
-
try {
|
|
179
|
-
if (rawPlugin.contributes.languages) {
|
|
180
|
-
const languages = this.readLanguages(rawPlugin.contributes.languages, rawPlugin.packagePath);
|
|
181
|
-
contributions.languages = languages;
|
|
182
|
-
}
|
|
183
|
-
} catch (err) {
|
|
184
|
-
console.error(`Could not read '${rawPlugin.name}' contribution 'languages'.`, rawPlugin.contributes.languages, err);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
179
|
try {
|
|
188
180
|
if (rawPlugin.contributes.submenus) {
|
|
189
181
|
contributions.submenus = this.readSubmenus(rawPlugin.contributes.submenus, rawPlugin);
|
|
@@ -192,15 +184,6 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
192
184
|
console.error(`Could not read '${rawPlugin.name}' contribution 'submenus'.`, rawPlugin.contributes.submenus, err);
|
|
193
185
|
}
|
|
194
186
|
|
|
195
|
-
try {
|
|
196
|
-
if (rawPlugin.contributes.grammars) {
|
|
197
|
-
const grammars = this.grammarsReader.readGrammars(rawPlugin.contributes.grammars, rawPlugin.packagePath);
|
|
198
|
-
contributions.grammars = grammars;
|
|
199
|
-
}
|
|
200
|
-
} catch (err) {
|
|
201
|
-
console.error(`Could not read '${rawPlugin.name}' contribution 'grammars'.`, rawPlugin.contributes.grammars, err);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
187
|
try {
|
|
205
188
|
if (rawPlugin.contributes.customEditors) {
|
|
206
189
|
const customEditors = this.readCustomEditors(rawPlugin.contributes.customEditors);
|
|
@@ -330,6 +313,12 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
330
313
|
console.error(`Could not read '${rawPlugin.name}' contribution 'notebooks'.`, rawPlugin.contributes.authentication, err);
|
|
331
314
|
}
|
|
332
315
|
|
|
316
|
+
try {
|
|
317
|
+
contributions.notebookRenderer = rawPlugin.contributes.notebookRenderer;
|
|
318
|
+
} catch (err) {
|
|
319
|
+
console.error(`Could not read '${rawPlugin.name}' contribution 'notebooks'.`, rawPlugin.contributes.authentication, err);
|
|
320
|
+
}
|
|
321
|
+
|
|
333
322
|
try {
|
|
334
323
|
contributions.snippets = this.readSnippets(rawPlugin);
|
|
335
324
|
} catch (err) {
|
|
@@ -354,18 +343,40 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
354
343
|
console.error(`Could not read '${rawPlugin.name}' contribution 'colors'.`, rawPlugin.contributes.colors, err);
|
|
355
344
|
}
|
|
356
345
|
|
|
357
|
-
try {
|
|
358
|
-
contributions.localizations = this.readLocalizations(rawPlugin);
|
|
359
|
-
} catch (err) {
|
|
360
|
-
console.error(`Could not read '${rawPlugin.name}' contribution 'localizations'.`, rawPlugin.contributes.colors, err);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
346
|
try {
|
|
364
347
|
contributions.terminalProfiles = this.readTerminals(rawPlugin);
|
|
365
348
|
} catch (err) {
|
|
366
349
|
console.error(`Could not read '${rawPlugin.name}' contribution 'terminals'.`, rawPlugin.contributes.terminal, err);
|
|
367
350
|
}
|
|
368
351
|
|
|
352
|
+
const [localizationsResult, languagesResult, grammarsResult] = await Promise.allSettled([
|
|
353
|
+
this.readLocalizations(rawPlugin),
|
|
354
|
+
rawPlugin.contributes.languages ? this.readLanguages(rawPlugin.contributes.languages, rawPlugin.packagePath) : undefined,
|
|
355
|
+
rawPlugin.contributes.grammars ? this.grammarsReader.readGrammars(rawPlugin.contributes.grammars, rawPlugin.packagePath) : undefined
|
|
356
|
+
]);
|
|
357
|
+
|
|
358
|
+
if (localizationsResult.status === 'fulfilled') {
|
|
359
|
+
contributions.localizations = localizationsResult.value;
|
|
360
|
+
} else {
|
|
361
|
+
console.error(`Could not read '${rawPlugin.name}' contribution 'localizations'.`, rawPlugin.contributes.localizations, localizationsResult.reason);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (rawPlugin.contributes.languages) {
|
|
365
|
+
if (languagesResult.status === 'fulfilled') {
|
|
366
|
+
contributions.languages = languagesResult.value;
|
|
367
|
+
} else {
|
|
368
|
+
console.error(`Could not read '${rawPlugin.name}' contribution 'languages'.`, rawPlugin.contributes.languages, languagesResult.reason);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (rawPlugin.contributes.grammars) {
|
|
373
|
+
if (grammarsResult.status === 'fulfilled') {
|
|
374
|
+
contributions.grammars = grammarsResult.value;
|
|
375
|
+
} else {
|
|
376
|
+
console.error(`Could not read '${rawPlugin.name}' contribution 'grammars'.`, rawPlugin.contributes.grammars, grammarsResult.reason);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
369
380
|
return contributions;
|
|
370
381
|
}
|
|
371
382
|
|
|
@@ -376,26 +387,26 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
376
387
|
return pck.contributes.terminal.profiles.filter(profile => profile.id && profile.title);
|
|
377
388
|
}
|
|
378
389
|
|
|
379
|
-
protected readLocalizations(pck: PluginPackage): Localization[] | undefined {
|
|
390
|
+
protected async readLocalizations(pck: PluginPackage): Promise<Localization[] | undefined> {
|
|
380
391
|
if (!pck.contributes || !pck.contributes.localizations) {
|
|
381
392
|
return undefined;
|
|
382
393
|
}
|
|
383
|
-
return pck.contributes.localizations.map(e => this.readLocalization(e, pck.packagePath));
|
|
394
|
+
return Promise.all(pck.contributes.localizations.map(e => this.readLocalization(e, pck.packagePath)));
|
|
384
395
|
}
|
|
385
396
|
|
|
386
|
-
protected readLocalization({ languageId, languageName, localizedLanguageName, translations }: PluginPackageLocalization, pluginPath: string): Localization {
|
|
397
|
+
protected async readLocalization({ languageId, languageName, localizedLanguageName, translations }: PluginPackageLocalization, pluginPath: string): Promise<Localization> {
|
|
387
398
|
const local: Localization = {
|
|
388
399
|
languageId,
|
|
389
400
|
languageName,
|
|
390
401
|
localizedLanguageName,
|
|
391
402
|
translations: []
|
|
392
403
|
};
|
|
393
|
-
local.translations = translations.map(e => this.readTranslation(e, pluginPath));
|
|
404
|
+
local.translations = await Promise.all(translations.map(e => this.readTranslation(e, pluginPath)));
|
|
394
405
|
return local;
|
|
395
406
|
}
|
|
396
407
|
|
|
397
|
-
protected readTranslation(packageTranslation: PluginPackageTranslation, pluginPath: string): Translation {
|
|
398
|
-
const translation = this.readJson<Translation>(path.resolve(pluginPath, packageTranslation.path));
|
|
408
|
+
protected async readTranslation(packageTranslation: PluginPackageTranslation, pluginPath: string): Promise<Translation> {
|
|
409
|
+
const translation = await this.readJson<Translation>(path.resolve(pluginPath, packageTranslation.path));
|
|
399
410
|
if (!translation) {
|
|
400
411
|
throw new Error(`Could not read json file '${packageTranslation.path}'.`);
|
|
401
412
|
}
|
|
@@ -529,15 +540,18 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
529
540
|
return result;
|
|
530
541
|
}
|
|
531
542
|
|
|
532
|
-
protected readJson<T>(filePath: string): T | undefined {
|
|
533
|
-
const content = this.
|
|
543
|
+
protected async readJson<T>(filePath: string): Promise<T | undefined> {
|
|
544
|
+
const content = await this.readFile(filePath);
|
|
534
545
|
return content ? jsoncparser.parse(content, undefined, { disallowComments: false }) : undefined;
|
|
535
546
|
}
|
|
536
|
-
protected
|
|
547
|
+
protected async readFile(filePath: string): Promise<string> {
|
|
537
548
|
try {
|
|
538
|
-
|
|
549
|
+
const content = await fs.readFile(filePath, { encoding: 'utf8' });
|
|
550
|
+
return content;
|
|
539
551
|
} catch (e) {
|
|
540
|
-
|
|
552
|
+
if (!isENOENT(e)) {
|
|
553
|
+
console.error(e);
|
|
554
|
+
}
|
|
541
555
|
return '';
|
|
542
556
|
}
|
|
543
557
|
}
|
|
@@ -644,8 +658,8 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
644
658
|
return result;
|
|
645
659
|
}
|
|
646
660
|
|
|
647
|
-
private readLanguages(rawLanguages: PluginPackageLanguageContribution[], pluginPath: string): LanguageContribution[] {
|
|
648
|
-
return rawLanguages.map(language => this.readLanguage(language, pluginPath));
|
|
661
|
+
private async readLanguages(rawLanguages: PluginPackageLanguageContribution[], pluginPath: string): Promise<LanguageContribution[]> {
|
|
662
|
+
return Promise.all(rawLanguages.map(language => this.readLanguage(language, pluginPath)));
|
|
649
663
|
}
|
|
650
664
|
|
|
651
665
|
private readSubmenus(rawSubmenus: PluginPackageSubmenu[], plugin: PluginPackage): Submenu[] {
|
|
@@ -662,7 +676,7 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
662
676
|
|
|
663
677
|
}
|
|
664
678
|
|
|
665
|
-
private readLanguage(rawLang: PluginPackageLanguageContribution, pluginPath: string): LanguageContribution {
|
|
679
|
+
private async readLanguage(rawLang: PluginPackageLanguageContribution, pluginPath: string): Promise<LanguageContribution> {
|
|
666
680
|
// TODO: add validation to all parameters
|
|
667
681
|
const result: LanguageContribution = {
|
|
668
682
|
id: rawLang.id,
|
|
@@ -674,7 +688,7 @@ export class TheiaPluginScanner implements PluginScanner {
|
|
|
674
688
|
mimetypes: rawLang.mimetypes
|
|
675
689
|
};
|
|
676
690
|
if (rawLang.configuration) {
|
|
677
|
-
const rawConfiguration = this.readJson<PluginPackageLanguageContributionConfiguration>(path.resolve(pluginPath, rawLang.configuration));
|
|
691
|
+
const rawConfiguration = await this.readJson<PluginPackageLanguageContributionConfiguration>(path.resolve(pluginPath, rawLang.configuration));
|
|
678
692
|
if (rawConfiguration) {
|
|
679
693
|
const configuration: LanguageConfiguration = {
|
|
680
694
|
brackets: rawConfiguration.brackets,
|
|
@@ -21,7 +21,7 @@ import { ApplicationShell, NavigatableWidget, Saveable, SaveableSource, SaveOpti
|
|
|
21
21
|
import { SaveResourceService } from '@theia/core/lib/browser/save-resource-service';
|
|
22
22
|
import { Reference } from '@theia/core/lib/common/reference';
|
|
23
23
|
import { WebviewWidget } from '../webview/webview';
|
|
24
|
-
import { UndoRedoService } from '
|
|
24
|
+
import { UndoRedoService } from '@theia/editor/lib/browser/undo-redo-service';
|
|
25
25
|
import { CustomEditorModel } from './custom-editors-main';
|
|
26
26
|
|
|
27
27
|
@injectable()
|
|
@@ -36,7 +36,7 @@ import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model
|
|
|
36
36
|
import { EditorModelService } from '../text-editor-model-service';
|
|
37
37
|
import { CustomEditorService } from './custom-editor-service';
|
|
38
38
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
39
|
-
import { UndoRedoService } from '
|
|
39
|
+
import { UndoRedoService } from '@theia/editor/lib/browser/undo-redo-service';
|
|
40
40
|
import { WebviewsMainImpl } from '../webviews-main';
|
|
41
41
|
import { WidgetManager } from '@theia/core/lib/browser/widget-manager';
|
|
42
42
|
import { ApplicationShell, DefaultUriLabelProviderContribution, Saveable, SaveOptions, WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
@@ -139,6 +139,7 @@ export class EditorsAndDocumentsMain implements Disposable {
|
|
|
139
139
|
uri: model.textEditorModel.uri,
|
|
140
140
|
versionId: model.textEditorModel.getVersionId(),
|
|
141
141
|
lines: model.textEditorModel.getLinesContent(),
|
|
142
|
+
languageId: model.getLanguageId(),
|
|
142
143
|
EOL: model.textEditorModel.getEOL(),
|
|
143
144
|
modeId: model.languageId,
|
|
144
145
|
isDirty: model.dirty
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
LanguagesExt,
|
|
33
33
|
WorkspaceEditDto,
|
|
34
34
|
WorkspaceTextEditDto,
|
|
35
|
+
WorkspaceFileEditDto,
|
|
35
36
|
PluginInfo,
|
|
36
37
|
LanguageStatus as LanguageStatusDTO,
|
|
37
38
|
InlayHintDto,
|
|
@@ -1418,13 +1419,15 @@ export function toMonacoWorkspaceEdit(data: WorkspaceEditDto | undefined): monac
|
|
|
1418
1419
|
metadata: edit.metadata
|
|
1419
1420
|
};
|
|
1420
1421
|
} else {
|
|
1422
|
+
const fileEdit = edit as WorkspaceFileEditDto;
|
|
1421
1423
|
return <monaco.languages.IWorkspaceFileEdit>{
|
|
1422
|
-
newResource: monaco.Uri.revive(
|
|
1423
|
-
oldResource: monaco.Uri.revive(
|
|
1424
|
-
options:
|
|
1425
|
-
metadata:
|
|
1424
|
+
newResource: monaco.Uri.revive(fileEdit.newResource),
|
|
1425
|
+
oldResource: monaco.Uri.revive(fileEdit.oldResource),
|
|
1426
|
+
options: fileEdit.options,
|
|
1427
|
+
metadata: fileEdit.metadata
|
|
1426
1428
|
};
|
|
1427
1429
|
}
|
|
1430
|
+
// TODO implement WorkspaceNotebookCellEditDto
|
|
1428
1431
|
})
|
|
1429
1432
|
};
|
|
1430
1433
|
}
|
|
@@ -59,7 +59,15 @@ import { MonacoLanguages } from '@theia/monaco/lib/browser/monaco-languages';
|
|
|
59
59
|
import { UntitledResourceResolver } from '@theia/core/lib/common/resource';
|
|
60
60
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
61
61
|
import { TabsMainImpl } from './tabs/tabs-main';
|
|
62
|
+
import { NotebooksMainImpl } from './notebooks/notebooks-main';
|
|
63
|
+
import { NotebookService } from '@theia/notebook/lib/browser';
|
|
62
64
|
import { LocalizationMainImpl } from './localization-main';
|
|
65
|
+
import { NotebookRenderersMainImpl } from './notebooks/notebook-renderers-main';
|
|
66
|
+
import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
|
|
67
|
+
import { NotebookEditorsMainImpl } from './notebooks/notebook-editors-main';
|
|
68
|
+
import { NotebookDocumentsMainImpl } from './notebooks/notebook-documents-main';
|
|
69
|
+
import { NotebookKernelsMainImpl } from './notebooks/notebook-kernels-main';
|
|
70
|
+
import { NotebooksAndEditorsMain } from './notebooks/notebook-documents-and-editors-main';
|
|
63
71
|
|
|
64
72
|
export function setUpPluginApi(rpc: RPCProtocol, container: interfaces.Container): void {
|
|
65
73
|
const authenticationMain = new AuthenticationMainImpl(rpc, container);
|
|
@@ -94,6 +102,17 @@ export function setUpPluginApi(rpc: RPCProtocol, container: interfaces.Container
|
|
|
94
102
|
const documentsMain = new DocumentsMainImpl(editorsAndDocuments, modelService, rpc, editorManager, openerService, shell, untitledResourceResolver, languageService);
|
|
95
103
|
rpc.set(PLUGIN_RPC_CONTEXT.DOCUMENTS_MAIN, documentsMain);
|
|
96
104
|
|
|
105
|
+
const notebookService = container.get(NotebookService);
|
|
106
|
+
const pluginSupport = container.get(HostedPluginSupport);
|
|
107
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOKS_MAIN, new NotebooksMainImpl(rpc, notebookService, pluginSupport));
|
|
108
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_MAIN, new NotebookRenderersMainImpl(rpc, container));
|
|
109
|
+
const notebookEditorsMain = new NotebookEditorsMainImpl(rpc, container);
|
|
110
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_EDITORS_MAIN, notebookEditorsMain);
|
|
111
|
+
const notebookDocumentsMain = new NotebookDocumentsMainImpl(rpc, container);
|
|
112
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_MAIN, notebookDocumentsMain);
|
|
113
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_AND_EDITORS_MAIN, new NotebooksAndEditorsMain(rpc, container, notebookDocumentsMain, notebookEditorsMain));
|
|
114
|
+
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_KERNELS_MAIN, new NotebookKernelsMainImpl(rpc, container));
|
|
115
|
+
|
|
97
116
|
const bulkEditService = container.get(MonacoBulkEditService);
|
|
98
117
|
const monacoEditorService = container.get(MonacoEditorService);
|
|
99
118
|
const editorsMain = new TextEditorsMainImpl(editorsAndDocuments, documentsMain, rpc, bulkEditService, monacoEditorService);
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
18
|
|
|
19
19
|
import { inject, injectable, optional } from '@theia/core/shared/inversify';
|
|
20
|
-
import { MenuPath, CommandRegistry, Disposable, DisposableCollection, ActionMenuNode, MenuCommandAdapterRegistry, Emitter } from '@theia/core';
|
|
20
|
+
import { MenuPath, CommandRegistry, Disposable, DisposableCollection, ActionMenuNode, MenuCommandAdapterRegistry, Emitter, nls } from '@theia/core';
|
|
21
21
|
import { MenuModelRegistry } from '@theia/core/lib/common';
|
|
22
22
|
import { TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
23
23
|
import { DeployedPlugin, IconUrl, Menu } from '../../../common';
|
|
24
24
|
import { ScmWidget } from '@theia/scm/lib/browser/scm-widget';
|
|
25
|
-
import { PluginViewWidget } from '../view/plugin-view-widget';
|
|
26
25
|
import { QuickCommandService } from '@theia/core/lib/browser';
|
|
27
26
|
import {
|
|
28
27
|
CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint,
|
|
@@ -56,9 +55,13 @@ export class MenusContributionPointHandler {
|
|
|
56
55
|
this.initialized = true;
|
|
57
56
|
this.commandAdapterRegistry.registerAdapter(this.commandAdapter);
|
|
58
57
|
this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_MENU, widget => this.codeEditorWidgetUtil.is(widget));
|
|
59
|
-
this.tabBarToolbar.
|
|
58
|
+
this.tabBarToolbar.registerItem({
|
|
59
|
+
id: this.tabBarToolbar.toElementId(PLUGIN_EDITOR_TITLE_RUN_MENU), menuPath: PLUGIN_EDITOR_TITLE_RUN_MENU,
|
|
60
|
+
icon: 'debug-alt', text: nls.localizeByDefault('Run or Debug...'),
|
|
61
|
+
command: '', group: 'navigation', isVisible: widget => this.codeEditorWidgetUtil.is(widget)
|
|
62
|
+
});
|
|
60
63
|
this.tabBarToolbar.registerMenuDelegate(PLUGIN_SCM_TITLE_MENU, widget => widget instanceof ScmWidget);
|
|
61
|
-
this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => widget
|
|
64
|
+
this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => !this.codeEditorWidgetUtil.is(widget));
|
|
62
65
|
this.tabBarToolbar.registerItem({ id: 'plugin-menu-contribution-title-contribution', command: '_never_', onDidChange: this.onDidChangeTitleContributionEmitter.event });
|
|
63
66
|
this.contextKeyService.onDidChange(event => {
|
|
64
67
|
if (event.affects(this.titleContributionContextKeys)) {
|