@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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Event } from '@theia/core';
|
|
2
|
+
import { UriComponents } from '@theia/core/lib/common/uri';
|
|
3
|
+
import { CellExecuteUpdateDto, CellExecutionCompleteDto, NotebookKernelDto, NotebookKernelsMain } from '../../../common';
|
|
4
|
+
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
5
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
6
|
+
import { NotebookKernelSourceAction } from '@theia/notebook/lib/common';
|
|
7
|
+
export interface KernelSourceActionProvider {
|
|
8
|
+
readonly viewType: string;
|
|
9
|
+
onDidChangeSourceActions?: Event<void>;
|
|
10
|
+
provideKernelSourceActions(): Promise<NotebookKernelSourceAction[]>;
|
|
11
|
+
}
|
|
12
|
+
export declare class NotebookKernelsMainImpl implements NotebookKernelsMain {
|
|
13
|
+
private readonly proxy;
|
|
14
|
+
private readonly kernels;
|
|
15
|
+
private readonly kernelDetectionTasks;
|
|
16
|
+
private readonly kernelSourceActionProviders;
|
|
17
|
+
private readonly kernelSourceActionProvidersEventRegistrations;
|
|
18
|
+
private notebookKernelService;
|
|
19
|
+
private notebookService;
|
|
20
|
+
private languageService;
|
|
21
|
+
private notebookExecutionStateService;
|
|
22
|
+
private readonly executions;
|
|
23
|
+
constructor(rpc: RPCProtocol, container: interfaces.Container);
|
|
24
|
+
$postMessage(handle: number, editorId: string | undefined, message: unknown): Promise<boolean>;
|
|
25
|
+
$addKernel(handle: number, data: NotebookKernelDto): Promise<void>;
|
|
26
|
+
$updateKernel(handle: number, data: Partial<NotebookKernelDto>): void;
|
|
27
|
+
$removeKernel(handle: number): void;
|
|
28
|
+
$updateNotebookPriority(handle: number, uri: UriComponents, value: number | undefined): void;
|
|
29
|
+
$createExecution(handle: number, controllerId: string, uriComponents: UriComponents, cellHandle: number): void;
|
|
30
|
+
$updateExecution(handle: number, updates: CellExecuteUpdateDto[]): void;
|
|
31
|
+
$completeExecution(handle: number, data: CellExecutionCompleteDto): void;
|
|
32
|
+
$createNotebookExecution(handle: number, controllerId: string, uri: UriComponents): void;
|
|
33
|
+
$beginNotebookExecution(handle: number): void;
|
|
34
|
+
$completeNotebookExecution(handle: number): void;
|
|
35
|
+
$addKernelDetectionTask(handle: number, notebookType: string): Promise<void>;
|
|
36
|
+
$removeKernelDetectionTask(handle: number): void;
|
|
37
|
+
$addKernelSourceActionProvider(handle: number, eventHandle: number, notebookType: string): Promise<void>;
|
|
38
|
+
$removeKernelSourceActionProvider(handle: number, eventHandle: number): void;
|
|
39
|
+
$emitNotebookKernelSourceActionsChangeEvent(eventHandle: number): void;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=notebook-kernels-main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-kernels-main.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebook-kernels-main.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA0C,KAAK,EAAO,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAoB,iBAAiB,EAAsB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAkFxE,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,0BAA0B,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC;CACvE;AAED,qBAAa,uBAAwB,YAAW,mBAAmB;IAE/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAE3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyE;IAEjG,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA4E;IAEjH,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAuF;IACnI,OAAO,CAAC,QAAQ,CAAC,6CAA6C,CAAiC;IAE/F,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,6BAA6B,CAAgC;IAErE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;gBAG3D,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,UAAU,CAAC,SAAS;IAUnC,YAAY,C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iC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAU5E,2CAA2C,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAGtE,OAAO,IAAI,IAAI;CAIlB"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.NotebookKernelsMainImpl = void 0;
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const language_service_1 = require("@theia/core/lib/browser/language-service");
|
|
25
|
+
const common_1 = require("../../../common");
|
|
26
|
+
const browser_1 = require("@theia/notebook/lib/browser");
|
|
27
|
+
const lifecycle_1 = require("@theia/monaco-editor-core/esm/vs/base/common/lifecycle");
|
|
28
|
+
const type_converters_1 = require("../../../plugin/type-converters");
|
|
29
|
+
class NotebookKernel {
|
|
30
|
+
constructor(data, languageService) {
|
|
31
|
+
var _a, _b, _c, _d;
|
|
32
|
+
this.languageService = languageService;
|
|
33
|
+
this.onDidChangeEmitter = new core_1.Emitter();
|
|
34
|
+
this.onDidChange = this.onDidChangeEmitter.event;
|
|
35
|
+
this.id = data.id;
|
|
36
|
+
this.viewType = data.notebookType;
|
|
37
|
+
this.extension = data.extensionId;
|
|
38
|
+
this.implementsInterrupt = (_a = data.supportsInterrupt) !== null && _a !== void 0 ? _a : false;
|
|
39
|
+
this.label = data.label;
|
|
40
|
+
this.description = data.description;
|
|
41
|
+
this.detail = data.detail;
|
|
42
|
+
this.supportedLanguages = (data.supportedLanguages && data.supportedLanguages.length > 0) ? data.supportedLanguages : languageService.languages.map(lang => lang.id);
|
|
43
|
+
this.implementsExecutionOrder = (_b = data.supportsExecutionOrder) !== null && _b !== void 0 ? _b : false;
|
|
44
|
+
this.preloads = (_d = (_c = data.preloads) === null || _c === void 0 ? void 0 : _c.map(u => ({ uri: core_1.URI.fromComponents(u.uri), provides: u.provides }))) !== null && _d !== void 0 ? _d : [];
|
|
45
|
+
}
|
|
46
|
+
get preloadUris() {
|
|
47
|
+
return this.preloads.map(p => p.uri);
|
|
48
|
+
}
|
|
49
|
+
get preloadProvides() {
|
|
50
|
+
return this.preloads.map(p => p.provides).flat();
|
|
51
|
+
}
|
|
52
|
+
update(data) {
|
|
53
|
+
const event = Object.create(null);
|
|
54
|
+
if (data.label !== undefined) {
|
|
55
|
+
this.label = data.label;
|
|
56
|
+
event.label = true;
|
|
57
|
+
}
|
|
58
|
+
if (data.description !== undefined) {
|
|
59
|
+
this.description = data.description;
|
|
60
|
+
event.description = true;
|
|
61
|
+
}
|
|
62
|
+
if (data.detail !== undefined) {
|
|
63
|
+
this.detail = data.detail;
|
|
64
|
+
event.detail = true;
|
|
65
|
+
}
|
|
66
|
+
if (data.supportedLanguages !== undefined) {
|
|
67
|
+
this.supportedLanguages = (data.supportedLanguages && data.supportedLanguages.length > 0) ?
|
|
68
|
+
data.supportedLanguages :
|
|
69
|
+
this.languageService.languages.map(lang => lang.id);
|
|
70
|
+
event.supportedLanguages = true;
|
|
71
|
+
}
|
|
72
|
+
if (data.supportsExecutionOrder !== undefined) {
|
|
73
|
+
this.implementsExecutionOrder = data.supportsExecutionOrder;
|
|
74
|
+
event.hasExecutionOrder = true;
|
|
75
|
+
}
|
|
76
|
+
if (data.supportsInterrupt !== undefined) {
|
|
77
|
+
this.implementsInterrupt = data.supportsInterrupt;
|
|
78
|
+
event.hasInterruptHandler = true;
|
|
79
|
+
}
|
|
80
|
+
this.onDidChangeEmitter.fire(event);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
class KernelDetectionTask {
|
|
84
|
+
constructor(notebookType) {
|
|
85
|
+
this.notebookType = notebookType;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
class NotebookKernelsMainImpl {
|
|
89
|
+
constructor(rpc, container) {
|
|
90
|
+
this.kernels = new Map();
|
|
91
|
+
this.kernelDetectionTasks = new Map();
|
|
92
|
+
this.kernelSourceActionProviders = new Map();
|
|
93
|
+
this.kernelSourceActionProvidersEventRegistrations = new Map();
|
|
94
|
+
this.executions = new Map();
|
|
95
|
+
this.proxy = rpc.getProxy(common_1.MAIN_RPC_CONTEXT.NOTEBOOK_KERNELS_EXT);
|
|
96
|
+
this.notebookKernelService = container.get(browser_1.NotebookKernelService);
|
|
97
|
+
this.notebookExecutionStateService = container.get(browser_1.NotebookExecutionStateService);
|
|
98
|
+
this.notebookService = container.get(browser_1.NotebookService);
|
|
99
|
+
this.languageService = container.get(language_service_1.LanguageService);
|
|
100
|
+
}
|
|
101
|
+
$postMessage(handle, editorId, message) {
|
|
102
|
+
throw new Error('Method not implemented.');
|
|
103
|
+
}
|
|
104
|
+
async $addKernel(handle, data) {
|
|
105
|
+
const that = this;
|
|
106
|
+
const kernel = new class extends NotebookKernel {
|
|
107
|
+
async executeNotebookCellsRequest(uri, handles) {
|
|
108
|
+
await that.proxy.$executeCells(handle, uri.toComponents(), handles);
|
|
109
|
+
}
|
|
110
|
+
async cancelNotebookCellExecution(uri, handles) {
|
|
111
|
+
await that.proxy.$cancelCells(handle, uri.toComponents(), handles);
|
|
112
|
+
}
|
|
113
|
+
}(data, this.languageService);
|
|
114
|
+
const listener = this.notebookKernelService.onDidChangeSelectedKernel(e => {
|
|
115
|
+
if (e.oldKernel === kernel.id) {
|
|
116
|
+
this.proxy.$acceptNotebookAssociation(handle, e.notebook.toComponents(), false);
|
|
117
|
+
}
|
|
118
|
+
else if (e.newKernel === kernel.id) {
|
|
119
|
+
this.proxy.$acceptNotebookAssociation(handle, e.notebook.toComponents(), true);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const registration = this.notebookKernelService.registerKernel(kernel);
|
|
123
|
+
this.kernels.set(handle, [kernel, (0, lifecycle_1.combinedDisposable)(listener, registration)]);
|
|
124
|
+
}
|
|
125
|
+
$updateKernel(handle, data) {
|
|
126
|
+
const tuple = this.kernels.get(handle);
|
|
127
|
+
if (tuple) {
|
|
128
|
+
tuple[0].update(data);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
$removeKernel(handle) {
|
|
132
|
+
const tuple = this.kernels.get(handle);
|
|
133
|
+
if (tuple) {
|
|
134
|
+
tuple[1].dispose();
|
|
135
|
+
this.kernels.delete(handle);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
$updateNotebookPriority(handle, uri, value) {
|
|
139
|
+
throw new Error('Method not implemented.');
|
|
140
|
+
}
|
|
141
|
+
$createExecution(handle, controllerId, uriComponents, cellHandle) {
|
|
142
|
+
var _a;
|
|
143
|
+
const uri = core_1.URI.fromComponents(uriComponents);
|
|
144
|
+
const notebook = this.notebookService.getNotebookEditorModel(uri);
|
|
145
|
+
if (!notebook) {
|
|
146
|
+
throw new Error(`Notebook not found: ${uri.toString()}`);
|
|
147
|
+
}
|
|
148
|
+
const kernel = this.notebookKernelService.getMatchingKernel(notebook);
|
|
149
|
+
if (!kernel.selected || kernel.selected.id !== controllerId) {
|
|
150
|
+
throw new Error(`Kernel is not selected: ${(_a = kernel.selected) === null || _a === void 0 ? void 0 : _a.id} !== ${controllerId}`);
|
|
151
|
+
}
|
|
152
|
+
const execution = this.notebookExecutionStateService.createCellExecution(uri, cellHandle);
|
|
153
|
+
execution.confirm();
|
|
154
|
+
this.executions.set(handle, execution);
|
|
155
|
+
}
|
|
156
|
+
$updateExecution(handle, updates) {
|
|
157
|
+
const execution = this.executions.get(handle);
|
|
158
|
+
execution === null || execution === void 0 ? void 0 : execution.update(updates.map(type_converters_1.NotebookDto.fromCellExecuteUpdateDto));
|
|
159
|
+
}
|
|
160
|
+
$completeExecution(handle, data) {
|
|
161
|
+
try {
|
|
162
|
+
const execution = this.executions.get(handle);
|
|
163
|
+
execution === null || execution === void 0 ? void 0 : execution.complete(type_converters_1.NotebookDto.fromCellExecuteCompleteDto(data));
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
this.executions.delete(handle);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// TODO implement notebook execution (special api for executing full notebook instead of just cells)
|
|
170
|
+
$createNotebookExecution(handle, controllerId, uri) {
|
|
171
|
+
throw new Error('Method not implemented.');
|
|
172
|
+
}
|
|
173
|
+
$beginNotebookExecution(handle) {
|
|
174
|
+
throw new Error('Method not implemented.');
|
|
175
|
+
}
|
|
176
|
+
$completeNotebookExecution(handle) {
|
|
177
|
+
throw new Error('Method not implemented.');
|
|
178
|
+
}
|
|
179
|
+
async $addKernelDetectionTask(handle, notebookType) {
|
|
180
|
+
const kernelDetectionTask = new KernelDetectionTask(notebookType);
|
|
181
|
+
const registration = this.notebookKernelService.registerNotebookKernelDetectionTask(kernelDetectionTask);
|
|
182
|
+
this.kernelDetectionTasks.set(handle, [kernelDetectionTask, registration]);
|
|
183
|
+
}
|
|
184
|
+
$removeKernelDetectionTask(handle) {
|
|
185
|
+
const tuple = this.kernelDetectionTasks.get(handle);
|
|
186
|
+
if (tuple) {
|
|
187
|
+
tuple[1].dispose();
|
|
188
|
+
this.kernelDetectionTasks.delete(handle);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async $addKernelSourceActionProvider(handle, eventHandle, notebookType) {
|
|
192
|
+
const kernelSourceActionProvider = {
|
|
193
|
+
viewType: notebookType,
|
|
194
|
+
provideKernelSourceActions: async () => {
|
|
195
|
+
const actions = await this.proxy.$provideKernelSourceActions(handle, core_1.CancellationToken.None);
|
|
196
|
+
return actions.map(action => ({
|
|
197
|
+
label: action.label,
|
|
198
|
+
command: action.command,
|
|
199
|
+
description: action.description,
|
|
200
|
+
detail: action.detail,
|
|
201
|
+
documentation: action.documentation,
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
if (typeof eventHandle === 'number') {
|
|
206
|
+
const emitter = new core_1.Emitter();
|
|
207
|
+
this.kernelSourceActionProvidersEventRegistrations.set(eventHandle, emitter);
|
|
208
|
+
kernelSourceActionProvider.onDidChangeSourceActions = emitter.event;
|
|
209
|
+
}
|
|
210
|
+
const registration = this.notebookKernelService.registerKernelSourceActionProvider(notebookType, kernelSourceActionProvider);
|
|
211
|
+
this.kernelSourceActionProviders.set(handle, [kernelSourceActionProvider, registration]);
|
|
212
|
+
}
|
|
213
|
+
$removeKernelSourceActionProvider(handle, eventHandle) {
|
|
214
|
+
const tuple = this.kernelSourceActionProviders.get(handle);
|
|
215
|
+
if (tuple) {
|
|
216
|
+
tuple[1].dispose();
|
|
217
|
+
this.kernelSourceActionProviders.delete(handle);
|
|
218
|
+
}
|
|
219
|
+
if (typeof eventHandle === 'number') {
|
|
220
|
+
this.kernelSourceActionProvidersEventRegistrations.delete(eventHandle);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
$emitNotebookKernelSourceActionsChangeEvent(eventHandle) {
|
|
224
|
+
}
|
|
225
|
+
dispose() {
|
|
226
|
+
this.kernels.forEach(kernel => kernel[1].dispose());
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.NotebookKernelsMainImpl = NotebookKernelsMainImpl;
|
|
230
|
+
//# sourceMappingURL=notebook-kernels-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-kernels-main.js","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebook-kernels-main.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF;;;gGAGgG;;;AAEhG,sCAAiF;AAEjF,+EAA2E;AAC3E,4CAA+J;AAE/J,yDAA8J;AAC9J,sFAA4F;AAG5F,qEAA8D;AAE9D,MAAe,cAAc;IAyBzB,YAAY,IAAuB,EAAU,eAAgC;;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAxB5D,uBAAkB,GAAG,IAAI,cAAO,EAA6B,CAAC;QAEtE,gBAAW,GAAqC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAuBnF,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;QAElC,IAAI,CAAC,mBAAmB,GAAG,MAAA,IAAI,CAAC,iBAAiB,mCAAI,KAAK,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,kBA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AC/D,CAAC;IAED,OAAO;QACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;CAEJ;AA9KD,0DA8KC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
2
|
+
import { NotebookRenderersMain } from '../../../common';
|
|
3
|
+
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
4
|
+
export declare class NotebookRenderersMainImpl implements NotebookRenderersMain {
|
|
5
|
+
private readonly proxy;
|
|
6
|
+
private readonly rendererMessagingService;
|
|
7
|
+
private readonly disposables;
|
|
8
|
+
constructor(rpc: RPCProtocol, container: interfaces.Container);
|
|
9
|
+
$postMessage(editorId: string | undefined, rendererId: string, message: unknown): Promise<boolean>;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=notebook-renderers-main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-renderers-main.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebook-renderers-main.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAA0C,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,qBAAa,yBAA0B,YAAW,qBAAqB;IACnE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAmC;IAE5E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAGtD,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,UAAU,CAAC,SAAS;IASnC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlG,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NotebookRenderersMainImpl = void 0;
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
const browser_1 = require("@theia/notebook/lib/browser");
|
|
21
|
+
const common_1 = require("../../../common");
|
|
22
|
+
class NotebookRenderersMainImpl {
|
|
23
|
+
constructor(rpc, container) {
|
|
24
|
+
this.disposables = new core_1.DisposableCollection();
|
|
25
|
+
this.proxy = rpc.getProxy(common_1.MAIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_EXT);
|
|
26
|
+
this.rendererMessagingService = container.get(browser_1.NotebookRendererMessagingService);
|
|
27
|
+
this.rendererMessagingService.onShouldPostMessage(e => {
|
|
28
|
+
this.proxy.$postRendererMessage(e.editorId, e.rendererId, e.message);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
$postMessage(editorId, rendererId, message) {
|
|
32
|
+
return this.rendererMessagingService.receiveMessage(editorId, rendererId, message);
|
|
33
|
+
}
|
|
34
|
+
dispose() {
|
|
35
|
+
this.disposables.dispose();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.NotebookRenderersMainImpl = NotebookRenderersMainImpl;
|
|
39
|
+
//# sourceMappingURL=notebook-renderers-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-renderers-main.js","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebook-renderers-main.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,sCAAmD;AAEnD,yDAA+E;AAC/E,4CAAgG;AAGhG,MAAa,yBAAyB;IAMlC,YACI,GAAgB,EAChB,SAA+B;QAJlB,gBAAW,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAMtD,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,yBAAgB,CAAC,sBAAsB,CAAC,CAAC;QACnE,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC,GAAG,CAAC,0CAAgC,CAAC,CAAC;QAChF,IAAI,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE;YAClD,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACP,CAAC;IAED,YAAY,CAAC,QAA4B,EAAE,UAAkB,EAAE,OAAgB;QAC3E,OAAO,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED,OAAO;QACH,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACJ;AAxBD,8DAwBC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NotebookExtensionDescription, TransientOptions } from '@theia/notebook/lib/common';
|
|
2
|
+
import { NotebookService } from '@theia/notebook/lib/browser';
|
|
3
|
+
import { NotebooksMain } from '../../../common';
|
|
4
|
+
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
5
|
+
import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin';
|
|
6
|
+
export declare class NotebooksMainImpl implements NotebooksMain {
|
|
7
|
+
private notebookService;
|
|
8
|
+
private readonly disposables;
|
|
9
|
+
private readonly proxy;
|
|
10
|
+
private readonly notebookSerializer;
|
|
11
|
+
private readonly notebookCellStatusBarRegistrations;
|
|
12
|
+
constructor(rpc: RPCProtocol, notebookService: NotebookService, plugins: HostedPluginSupport);
|
|
13
|
+
dispose(): void;
|
|
14
|
+
$registerNotebookSerializer(handle: number, extension: NotebookExtensionDescription, viewType: string, options: TransientOptions): void;
|
|
15
|
+
$unregisterNotebookSerializer(handle: number): void;
|
|
16
|
+
$emitCellStatusBarEvent(eventHandle: number): void;
|
|
17
|
+
$registerNotebookCellStatusBarItemProvider(handle: number, eventHandle: number | undefined, viewType: string): Promise<void>;
|
|
18
|
+
$unregisterNotebookCellStatusBarItemProvider(handle: number, eventHandle: number | undefined): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=notebooks-main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebooks-main.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebooks-main.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAkF,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC5K,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAkC,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,qBAAa,iBAAkB,YAAW,aAAa;IAU/C,OAAO,CAAC,eAAe;IAR3B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;IAE1D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAiC;IACpE,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAiC;gBAGhF,GAAG,EAAE,WAAW,EACR,eAAe,EAAE,eAAe,EACxC,OAAO,EAAE,mBAAmB;IAOhC,OAAO,IAAI,IAAI;IAOf,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAiBvI,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKnD,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAO5C,0CAA0C,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B5H,4CAA4C,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAcrH"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NotebooksMainImpl = void 0;
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
const common_1 = require("../../../common");
|
|
21
|
+
const notebook_dto_1 = require("./notebook-dto");
|
|
22
|
+
class NotebooksMainImpl {
|
|
23
|
+
constructor(rpc, notebookService, plugins) {
|
|
24
|
+
this.notebookService = notebookService;
|
|
25
|
+
this.disposables = new core_1.DisposableCollection();
|
|
26
|
+
this.notebookSerializer = new Map();
|
|
27
|
+
this.notebookCellStatusBarRegistrations = new Map();
|
|
28
|
+
this.proxy = rpc.getProxy(common_1.MAIN_RPC_CONTEXT.NOTEBOOKS_EXT);
|
|
29
|
+
notebookService.onNotebookSerializer(async (event) => plugins.activateByEvent(event));
|
|
30
|
+
notebookService.markReady();
|
|
31
|
+
}
|
|
32
|
+
dispose() {
|
|
33
|
+
this.disposables.dispose();
|
|
34
|
+
for (const disposable of this.notebookSerializer.values()) {
|
|
35
|
+
disposable.dispose();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
$registerNotebookSerializer(handle, extension, viewType, options) {
|
|
39
|
+
const disposables = new core_1.DisposableCollection();
|
|
40
|
+
disposables.push(this.notebookService.registerNotebookSerializer(viewType, extension, {
|
|
41
|
+
options,
|
|
42
|
+
dataToNotebook: async (data) => {
|
|
43
|
+
const dto = await this.proxy.$dataToNotebook(handle, data, core_1.CancellationToken.None);
|
|
44
|
+
return notebook_dto_1.NotebookDto.fromNotebookDataDto(dto);
|
|
45
|
+
},
|
|
46
|
+
notebookToData: (data) => this.proxy.$notebookToData(handle, notebook_dto_1.NotebookDto.toNotebookDataDto(data), core_1.CancellationToken.None)
|
|
47
|
+
}));
|
|
48
|
+
this.notebookSerializer.set(handle, disposables);
|
|
49
|
+
}
|
|
50
|
+
$unregisterNotebookSerializer(handle) {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = this.notebookSerializer.get(handle)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
53
|
+
this.notebookSerializer.delete(handle);
|
|
54
|
+
}
|
|
55
|
+
$emitCellStatusBarEvent(eventHandle) {
|
|
56
|
+
const emitter = this.notebookCellStatusBarRegistrations.get(eventHandle);
|
|
57
|
+
if (emitter instanceof core_1.Emitter) {
|
|
58
|
+
emitter.fire(undefined);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async $registerNotebookCellStatusBarItemProvider(handle, eventHandle, viewType) {
|
|
62
|
+
const that = this;
|
|
63
|
+
const provider = {
|
|
64
|
+
async provideCellStatusBarItems(uri, index, token) {
|
|
65
|
+
var _a;
|
|
66
|
+
const result = await that.proxy.$provideNotebookCellStatusBarItems(handle, uri, index, token);
|
|
67
|
+
return {
|
|
68
|
+
items: (_a = result === null || result === void 0 ? void 0 : result.items) !== null && _a !== void 0 ? _a : [],
|
|
69
|
+
dispose() {
|
|
70
|
+
if (result) {
|
|
71
|
+
that.proxy.$releaseNotebookCellStatusBarItems(result.cacheId);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
viewType
|
|
77
|
+
};
|
|
78
|
+
if (typeof eventHandle === 'number') {
|
|
79
|
+
const emitter = new core_1.Emitter();
|
|
80
|
+
this.notebookCellStatusBarRegistrations.set(eventHandle, emitter);
|
|
81
|
+
provider.onDidChangeStatusBarItems = emitter.event;
|
|
82
|
+
}
|
|
83
|
+
// const disposable = this._cellStatusBarService.registerCellStatusBarItemProvider(provider);
|
|
84
|
+
// this.notebookCellStatusBarRegistrations.set(handle, disposable);
|
|
85
|
+
}
|
|
86
|
+
async $unregisterNotebookCellStatusBarItemProvider(handle, eventHandle) {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
88
|
+
const unregisterThing = (statusBarHandle) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const entry = this.notebookCellStatusBarRegistrations.get(statusBarHandle);
|
|
91
|
+
if (entry) {
|
|
92
|
+
(_a = this.notebookCellStatusBarRegistrations.get(statusBarHandle)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
93
|
+
this.notebookCellStatusBarRegistrations.delete(statusBarHandle);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
unregisterThing(handle);
|
|
97
|
+
if (typeof eventHandle === 'number') {
|
|
98
|
+
unregisterThing(eventHandle);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.NotebooksMainImpl = NotebooksMainImpl;
|
|
103
|
+
//# sourceMappingURL=notebooks-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebooks-main.js","sourceRoot":"","sources":["../../../../src/main/browser/notebooks/notebooks-main.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,sCAA+E;AAK/E,4CAAgF;AAEhF,iDAA6C;AAI7C,MAAa,iBAAiB;IAQ1B,YACI,GAAgB,EACR,eAAgC,EACxC,OAA4B;QADpB,oBAAe,GAAf,eAAe,CAAiB;QAR3B,gBAAW,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAGzC,uBAAkB,GAAG,IAAI,GAAG,EAAsB,CAAC;QACnD,uCA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6F;QAC7F,mEAAmE;IACvE,CAAC;IAED,KAAK,CAAC,4CAA4C,CAAC,MAAc,EAAE,WAA+B;QAC9F,wDAAwD;QACxD,MAAM,eAAe,GAAG,CAAC,eAAuB,EAAE,EAAE;;YAChD,MAAM,KAAK,GAAG,IAAI,CAAC,kCAAkC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC3E,IAAI,KAAK,EAAE;gBACP,MAAA,IAAI,CAAC,kCAAkC,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,OAAO,EAAE,CAAC;gBACxE,IAAI,CAAC,kCAAkC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;aACnE;QACL,CAAC,CAAC;QACF,eAAe,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACjC,eAAe,CAAC,WAAW,CAAC,CAAC;SAChC;IACL,CAAC;CACJ;AA/FD,8CA+FC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React from '@theia/core/shared/react';
|
|
3
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
4
|
+
import { NotebookRendererMessagingService, CellOutputWebview, NotebookRendererRegistry, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
|
|
5
|
+
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
|
|
6
|
+
import { WebviewWidget } from '../../webview/webview';
|
|
7
|
+
import { WidgetManager } from '@theia/core/lib/browser';
|
|
8
|
+
import { WorkspaceTrustService } from '@theia/workspace/lib/browser';
|
|
9
|
+
import { NotebookCellOutputsSplice } from '@theia/notebook/lib/common';
|
|
10
|
+
import { Disposable, DisposableCollection, QuickPickService } from '@theia/core';
|
|
11
|
+
export declare function createCellOutputWebviewContainer(ctx: interfaces.Container, cell: NotebookCellModel): interfaces.Container;
|
|
12
|
+
export declare class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
13
|
+
protected readonly messagingService: NotebookRendererMessagingService;
|
|
14
|
+
protected readonly cell: NotebookCellModel;
|
|
15
|
+
protected readonly widgetManager: WidgetManager;
|
|
16
|
+
protected readonly workspaceTrustService: WorkspaceTrustService;
|
|
17
|
+
protected readonly notebookRendererRegistry: NotebookRendererRegistry;
|
|
18
|
+
protected readonly notebookEditorWidgetService: NotebookEditorWidgetService;
|
|
19
|
+
protected readonly quickPickService: QuickPickService;
|
|
20
|
+
readonly id: string;
|
|
21
|
+
protected readonly elementRef: React.RefObject<HTMLDivElement>;
|
|
22
|
+
protected outputPresentationListeners: DisposableCollection;
|
|
23
|
+
protected webviewWidget: WebviewWidget;
|
|
24
|
+
protected init(): Promise<void>;
|
|
25
|
+
render(): React.JSX.Element;
|
|
26
|
+
attachWebview(): void;
|
|
27
|
+
isAttached(): boolean;
|
|
28
|
+
updateOutput(update: NotebookCellOutputsSplice): void;
|
|
29
|
+
private requestOutputPresentationUpdate;
|
|
30
|
+
private handleWebviewMessage;
|
|
31
|
+
private createWebviewContent;
|
|
32
|
+
private preloadsScriptString;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=cell-output-webview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-output-webview.d.ts","sourceRoot":"","sources":["../../../../../src/main/browser/notebooks/renderers/cell-output-webview.tsx"],"names":[],"mappings":";AAoBA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAsB,UAAU,EAAiB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAEzJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEjE,O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