@theia/plugin-ext 1.40.1 → 1.42.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-ext-backend-module.js +3 -3
- package/lib/main/node/plugin-ext-backend-module.js.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/{plugin-localization-backend-contribution.d.ts → plugin-localization-server.d.ts} +3 -3
- package/lib/main/node/plugin-localization-server.d.ts.map +1 -0
- package/lib/main/node/{plugin-localization-backend-contribution.js → plugin-localization-server.js} +8 -8
- package/lib/main/node/plugin-localization-server.js.map +1 -0
- 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 +80 -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/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +1 -0
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/stubs/tests-api.d.ts +1 -0
- package/lib/plugin/stubs/tests-api.d.ts.map +1 -1
- package/lib/plugin/stubs/tests-api.js +3 -1
- package/lib/plugin/stubs/tests-api.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 +374 -14
- 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-ext-backend-module.ts +3 -3
- package/src/main/node/plugin-github-resolver.ts +15 -8
- package/src/main/node/plugin-http-resolver.ts +15 -8
- package/src/main/node/{plugin-localization-backend-contribution.ts → plugin-localization-server.ts} +2 -2
- 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 +80 -71
- package/src/plugin/plugin-manager.ts +9 -1
- package/src/plugin/quick-open.ts +1 -0
- package/src/plugin/stubs/tests-api.ts +4 -0
- 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 +372 -13
- 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/lib/main/node/plugin-localization-backend-contribution.d.ts.map +0 -1
- package/lib/main/node/plugin-localization-backend-contribution.js.map +0 -1
- package/src/main/browser/custom-editors/undo-redo-service.ts +0 -120
|
@@ -98,6 +98,7 @@ import {
|
|
|
98
98
|
DataTransfer,
|
|
99
99
|
TreeItem,
|
|
100
100
|
TreeItemCollapsibleState,
|
|
101
|
+
TreeItemCheckboxState,
|
|
101
102
|
DocumentSymbol,
|
|
102
103
|
SymbolTag,
|
|
103
104
|
WorkspaceEdit,
|
|
@@ -165,8 +166,8 @@ import {
|
|
|
165
166
|
InlayHintKind,
|
|
166
167
|
InlayHintLabelPart,
|
|
167
168
|
TelemetryTrustedValue,
|
|
168
|
-
NotebookCell,
|
|
169
169
|
NotebookCellKind,
|
|
170
|
+
NotebookCellExecutionState,
|
|
170
171
|
NotebookCellStatusBarAlignment,
|
|
171
172
|
NotebookEditorRevealType,
|
|
172
173
|
NotebookControllerAffinity,
|
|
@@ -174,10 +175,11 @@ import {
|
|
|
174
175
|
NotebookCellOutput,
|
|
175
176
|
NotebookCellOutputItem,
|
|
176
177
|
NotebookData,
|
|
177
|
-
NotebookDocument,
|
|
178
178
|
NotebookRange,
|
|
179
179
|
NotebookCellStatusBarItem,
|
|
180
180
|
NotebookEdit,
|
|
181
|
+
NotebookKernelSourceAction,
|
|
182
|
+
NotebookRendererScript,
|
|
181
183
|
TestRunProfileKind,
|
|
182
184
|
TestTag,
|
|
183
185
|
TestRunRequest,
|
|
@@ -230,7 +232,8 @@ import {
|
|
|
230
232
|
createRunProfile,
|
|
231
233
|
createTestRun,
|
|
232
234
|
testItemCollection,
|
|
233
|
-
createTestItem
|
|
235
|
+
createTestItem,
|
|
236
|
+
invalidateTestResults
|
|
234
237
|
} from './stubs/tests-api';
|
|
235
238
|
import { TimelineExtImpl } from './timeline';
|
|
236
239
|
import { ThemingExtImpl } from './theming';
|
|
@@ -242,7 +245,13 @@ import { Endpoint } from '@theia/core/lib/browser/endpoint';
|
|
|
242
245
|
import { FilePermission } from '@theia/filesystem/lib/common/files';
|
|
243
246
|
import { TabsExtImpl } from './tabs';
|
|
244
247
|
import { LocalizationExtImpl } from './localization-ext';
|
|
248
|
+
import { NotebooksExtImpl } from './notebook/notebooks';
|
|
245
249
|
import { TelemetryExtImpl } from './telemetry-ext';
|
|
250
|
+
import { NotebookDocument } from './notebook/notebook-document';
|
|
251
|
+
import { NotebookRenderersExtImpl } from './notebook/notebook-renderers';
|
|
252
|
+
import { NotebookKernelsExtImpl } from './notebook/notebook-kernels';
|
|
253
|
+
import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
|
|
254
|
+
import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
|
|
246
255
|
|
|
247
256
|
export function createAPIFactory(
|
|
248
257
|
rpc: RPCProtocol,
|
|
@@ -266,6 +275,11 @@ export function createAPIFactory(
|
|
|
266
275
|
const notificationExt = rpc.set(MAIN_RPC_CONTEXT.NOTIFICATION_EXT, new NotificationExtImpl(rpc));
|
|
267
276
|
const editors = rpc.set(MAIN_RPC_CONTEXT.TEXT_EDITORS_EXT, new TextEditorsExtImpl(rpc, editorsAndDocumentsExt));
|
|
268
277
|
const documents = rpc.set(MAIN_RPC_CONTEXT.DOCUMENTS_EXT, new DocumentsExtImpl(rpc, editorsAndDocumentsExt));
|
|
278
|
+
const notebooksExt = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOKS_EXT, new NotebooksExtImpl(rpc, commandRegistry, editorsAndDocumentsExt, documents));
|
|
279
|
+
const notebookEditors = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_EDITORS_EXT, new NotebookEditorsExtImpl(notebooksExt));
|
|
280
|
+
const notebookRenderers = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_EXT, new NotebookRenderersExtImpl(rpc, notebooksExt));
|
|
281
|
+
const notebookKernels = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_KERNELS_EXT, new NotebookKernelsExtImpl(rpc, notebooksExt, commandRegistry));
|
|
282
|
+
const notebookDocuments = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_EXT, new NotebookDocumentsExtImpl(notebooksExt));
|
|
269
283
|
const statusBarMessageRegistryExt = new StatusBarMessageRegistryExt(rpc);
|
|
270
284
|
const terminalExt = rpc.set(MAIN_RPC_CONTEXT.TERMINAL_EXT, new TerminalServiceExtImpl(rpc));
|
|
271
285
|
const outputChannelRegistryExt = rpc.set(MAIN_RPC_CONTEXT.OUTPUT_CHANNEL_REGISTRY_EXT, new OutputChannelRegistryExtImpl(rpc));
|
|
@@ -427,24 +441,24 @@ export function createAPIFactory(
|
|
|
427
441
|
}
|
|
428
442
|
},
|
|
429
443
|
get visibleNotebookEditors(): theia.NotebookEditor[] {
|
|
430
|
-
return
|
|
444
|
+
return notebooksExt.visibleApiNotebookEditors;
|
|
431
445
|
},
|
|
432
446
|
onDidChangeVisibleNotebookEditors(listener, thisArg?, disposables?) {
|
|
433
|
-
return
|
|
447
|
+
return notebooksExt.onDidChangeVisibleNotebookEditors(listener, thisArg, disposables);
|
|
434
448
|
},
|
|
435
449
|
get activeNotebookEditor(): theia.NotebookEditor | undefined {
|
|
436
|
-
return
|
|
450
|
+
return notebooksExt.activeApiNotebookEditor;
|
|
437
451
|
}, onDidChangeActiveNotebookEditor(listener, thisArg?, disposables?) {
|
|
438
|
-
return
|
|
452
|
+
return notebooksExt.onDidChangeActiveNotebookEditor(listener, thisArg, disposables);
|
|
439
453
|
},
|
|
440
454
|
onDidChangeNotebookEditorSelection(listener, thisArg?, disposables?) {
|
|
441
|
-
return
|
|
455
|
+
return notebookEditors.onDidChangeNotebookEditorSelection(listener, thisArg, disposables);
|
|
442
456
|
},
|
|
443
457
|
onDidChangeNotebookEditorVisibleRanges(listener, thisArg?, disposables?) {
|
|
444
|
-
return
|
|
458
|
+
return notebookEditors.onDidChangeNotebookEditorVisibleRanges(listener, thisArg, disposables);
|
|
445
459
|
},
|
|
446
|
-
showNotebookDocument(document: NotebookDocument, options?: theia.NotebookDocumentShowOptions) {
|
|
447
|
-
return
|
|
460
|
+
showNotebookDocument(document: theia.NotebookDocument, options?: theia.NotebookDocumentShowOptions) {
|
|
461
|
+
return notebooksExt.showNotebookDocument(document, options);
|
|
448
462
|
},
|
|
449
463
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
450
464
|
showQuickPick(items: any, options?: theia.QuickPickOptions, token?: theia.CancellationToken): any {
|
|
@@ -616,7 +630,7 @@ export function createAPIFactory(
|
|
|
616
630
|
return workspaceExt.onDidChangeWorkspaceFolders(listener, thisArg, disposables);
|
|
617
631
|
},
|
|
618
632
|
get notebookDocuments(): theia.NotebookDocument[] {
|
|
619
|
-
return
|
|
633
|
+
return notebooksExt.getAllApiDocuments();
|
|
620
634
|
},
|
|
621
635
|
get textDocuments(): theia.TextDocument[] {
|
|
622
636
|
return documents.getAllDocumentData().map(data => data.document);
|
|
@@ -628,19 +642,19 @@ export function createAPIFactory(
|
|
|
628
642
|
return documents.onDidRemoveDocument(listener, thisArg, disposables);
|
|
629
643
|
},
|
|
630
644
|
onDidOpenNotebookDocument(listener, thisArg?, disposables?) {
|
|
631
|
-
return
|
|
645
|
+
return notebooksExt.onDidOpenNotebookDocument(listener, thisArg, disposables);
|
|
632
646
|
},
|
|
633
647
|
onDidCloseNotebookDocument(listener, thisArg?, disposables?) {
|
|
634
|
-
return
|
|
635
|
-
},
|
|
636
|
-
onDidChangeNotebookDocument(listener, thisArg?, disposables?) {
|
|
637
|
-
return Disposable.NULL;
|
|
648
|
+
return notebooksExt.onDidCloseNotebookDocument(listener, thisArg, disposables);
|
|
638
649
|
},
|
|
639
650
|
onWillSaveNotebookDocument(listener, thisArg?, disposables?) {
|
|
640
651
|
return Disposable.NULL;
|
|
641
652
|
},
|
|
642
|
-
onDidSaveNotebookDocument(listener, thisArg
|
|
643
|
-
return
|
|
653
|
+
onDidSaveNotebookDocument(listener, thisArg, disposables) {
|
|
654
|
+
return notebookDocuments.onDidSaveNotebookDocument(listener, thisArg, disposables);
|
|
655
|
+
},
|
|
656
|
+
onDidChangeNotebookDocument(listener, thisArg, disposables) {
|
|
657
|
+
return notebookDocuments.onDidChangeNotebookDocument(listener, thisArg, disposables);
|
|
644
658
|
},
|
|
645
659
|
onDidOpenTextDocument(listener, thisArg?, disposables?) {
|
|
646
660
|
return documents.onDidAddDocument(listener, thisArg, disposables);
|
|
@@ -686,8 +700,18 @@ export function createAPIFactory(
|
|
|
686
700
|
const data = await documents.openDocument(uri);
|
|
687
701
|
return data && data.document;
|
|
688
702
|
},
|
|
689
|
-
openNotebookDocument(
|
|
690
|
-
|
|
703
|
+
async openNotebookDocument(uriOrType: theia.Uri | string, content?: NotebookData): Promise<theia.NotebookDocument | undefined> {
|
|
704
|
+
let uri: URI;
|
|
705
|
+
if (URI.isUri(uriOrType)) {
|
|
706
|
+
uri = uriOrType;
|
|
707
|
+
await notebooksExt.openNotebookDocument(uriOrType as URI);
|
|
708
|
+
} else if (typeof uriOrType === 'string') {
|
|
709
|
+
uri = URI.revive(await notebooksExt.createNotebookDocument({ viewType: uriOrType, content }));
|
|
710
|
+
} else {
|
|
711
|
+
throw new Error('Invalid arguments');
|
|
712
|
+
}
|
|
713
|
+
return notebooksExt.getNotebookDocument(uri).apiNotebook;
|
|
714
|
+
|
|
691
715
|
},
|
|
692
716
|
createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
|
|
693
717
|
extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
|
|
@@ -729,7 +753,7 @@ export function createAPIFactory(
|
|
|
729
753
|
return timelineExt.registerTimelineProvider(plugin, scheme, provider);
|
|
730
754
|
},
|
|
731
755
|
registerNotebookSerializer(notebookType: string, serializer: theia.NotebookSerializer, options?: theia.NotebookDocumentContentOptions): theia.Disposable {
|
|
732
|
-
return
|
|
756
|
+
return notebooksExt.registerNotebookSerializer(plugin, notebookType, serializer, options);
|
|
733
757
|
},
|
|
734
758
|
get isTrusted(): boolean {
|
|
735
759
|
return workspaceExt.trusted;
|
|
@@ -987,6 +1011,7 @@ export function createAPIFactory(
|
|
|
987
1011
|
createRunProfile,
|
|
988
1012
|
createTestRun,
|
|
989
1013
|
createTestItem,
|
|
1014
|
+
invalidateTestResults,
|
|
990
1015
|
dispose: () => undefined,
|
|
991
1016
|
};
|
|
992
1017
|
},
|
|
@@ -1156,54 +1181,27 @@ export function createAPIFactory(
|
|
|
1156
1181
|
label,
|
|
1157
1182
|
handler?: (cells: theia.NotebookCell[],
|
|
1158
1183
|
notebook: theia.NotebookDocument,
|
|
1159
|
-
controller: theia.NotebookController) => void | Thenable<void
|
|
1184
|
+
controller: theia.NotebookController) => void | Thenable<void>,
|
|
1185
|
+
rendererScripts?: NotebookRendererScript[]
|
|
1160
1186
|
) {
|
|
1161
|
-
return
|
|
1162
|
-
id,
|
|
1163
|
-
notebookType,
|
|
1164
|
-
label,
|
|
1165
|
-
handler,
|
|
1166
|
-
createNotebookCellExecution: (cell: NotebookCell) => ({
|
|
1167
|
-
cell,
|
|
1168
|
-
token: CancellationToken.None,
|
|
1169
|
-
executionOrder: undefined,
|
|
1170
|
-
start: () => undefined,
|
|
1171
|
-
end: () => undefined,
|
|
1172
|
-
clearOutput: () => ({} as Thenable<void>),
|
|
1173
|
-
replaceOutput: () => ({} as Thenable<void>),
|
|
1174
|
-
appendOutput: () => ({} as Thenable<void>),
|
|
1175
|
-
replaceOutputItems: () => ({} as Thenable<void>),
|
|
1176
|
-
appendOutputItems: () => ({} as Thenable<void>)
|
|
1177
|
-
}),
|
|
1178
|
-
executeHandler(
|
|
1179
|
-
cells: theia.NotebookCell[],
|
|
1180
|
-
notebook: theia.NotebookDocument,
|
|
1181
|
-
controller: theia.NotebookController
|
|
1182
|
-
): (void | Thenable<void>) { },
|
|
1183
|
-
onDidChangeSelectedNotebooks: () => Disposable.create(() => { }),
|
|
1184
|
-
updateNotebookAffinity: (notebook: theia.NotebookDocument, affinity: theia.NotebookControllerAffinity) => undefined,
|
|
1185
|
-
dispose: () => undefined,
|
|
1186
|
-
};
|
|
1187
|
-
|
|
1187
|
+
return notebookKernels.createNotebookController(plugin.model.id, id, notebookType, label, handler, rendererScripts);
|
|
1188
1188
|
},
|
|
1189
|
-
createRendererMessaging(
|
|
1190
|
-
rendererId
|
|
1191
|
-
) {
|
|
1192
|
-
return {
|
|
1193
|
-
rendererId,
|
|
1194
|
-
onDidReceiveMessage: () => Disposable.create(() => { }),
|
|
1195
|
-
postMessage: () => Promise.resolve({}),
|
|
1196
|
-
};
|
|
1189
|
+
createRendererMessaging(rendererId) {
|
|
1190
|
+
return notebookRenderers.createRendererMessaging(rendererId);
|
|
1197
1191
|
},
|
|
1198
1192
|
registerNotebookCellStatusBarItemProvider(
|
|
1199
1193
|
notebookType,
|
|
1200
1194
|
provider
|
|
1201
1195
|
) {
|
|
1202
|
-
return
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1196
|
+
return notebooksExt.registerNotebookCellStatusBarItemProvider(notebookType, provider);
|
|
1197
|
+
},
|
|
1198
|
+
onDidChangeNotebookCellExecutionState: notebookKernels.onDidChangeNotebookCellExecutionState,
|
|
1199
|
+
|
|
1200
|
+
createNotebookControllerDetectionTask(notebookType: string) {
|
|
1201
|
+
return notebookKernels.createNotebookControllerDetectionTask(notebookType);
|
|
1202
|
+
},
|
|
1203
|
+
registerKernelSourceActionProvider(notebookType: string, provider: theia.NotebookKernelSourceActionProvider) {
|
|
1204
|
+
return notebookKernels.registerKernelSourceActionProvider(notebookType, provider);
|
|
1207
1205
|
}
|
|
1208
1206
|
};
|
|
1209
1207
|
|
|
@@ -1291,6 +1289,7 @@ export function createAPIFactory(
|
|
|
1291
1289
|
DataTransfer,
|
|
1292
1290
|
TreeItem,
|
|
1293
1291
|
TreeItemCollapsibleState,
|
|
1292
|
+
TreeItemCheckboxState,
|
|
1294
1293
|
SymbolKind,
|
|
1295
1294
|
SymbolTag,
|
|
1296
1295
|
DocumentSymbol,
|
|
@@ -1357,6 +1356,7 @@ export function createAPIFactory(
|
|
|
1357
1356
|
InlayHintLabelPart,
|
|
1358
1357
|
TelemetryTrustedValue,
|
|
1359
1358
|
NotebookCellData,
|
|
1359
|
+
NotebookCellExecutionState,
|
|
1360
1360
|
NotebookCellKind,
|
|
1361
1361
|
NotebookCellOutput,
|
|
1362
1362
|
NotebookCellOutputItem,
|
|
@@ -1368,6 +1368,8 @@ export function createAPIFactory(
|
|
|
1368
1368
|
NotebookDocument,
|
|
1369
1369
|
NotebookRange,
|
|
1370
1370
|
NotebookEdit,
|
|
1371
|
+
NotebookKernelSourceAction,
|
|
1372
|
+
NotebookRendererScript,
|
|
1371
1373
|
TestRunProfileKind,
|
|
1372
1374
|
TestTag,
|
|
1373
1375
|
TestRunRequest,
|
|
@@ -1420,6 +1422,8 @@ export interface ExtensionPlugin<T> extends theia.Plugin<T> {
|
|
|
1420
1422
|
}
|
|
1421
1423
|
|
|
1422
1424
|
export class Plugin<T> implements theia.Plugin<T> {
|
|
1425
|
+
#pluginManager: PluginManager;
|
|
1426
|
+
|
|
1423
1427
|
id: string;
|
|
1424
1428
|
pluginPath: string;
|
|
1425
1429
|
pluginUri: theia.Uri;
|
|
@@ -1427,7 +1431,9 @@ export class Plugin<T> implements theia.Plugin<T> {
|
|
|
1427
1431
|
packageJSON: any;
|
|
1428
1432
|
pluginType: theia.PluginType;
|
|
1429
1433
|
|
|
1430
|
-
constructor(
|
|
1434
|
+
constructor(pluginManager: PluginManager, plugin: InternalPlugin) {
|
|
1435
|
+
this.#pluginManager = pluginManager;
|
|
1436
|
+
|
|
1431
1437
|
this.id = plugin.model.id;
|
|
1432
1438
|
this.pluginPath = plugin.pluginFolder;
|
|
1433
1439
|
this.packageJSON = plugin.rawModel;
|
|
@@ -1442,26 +1448,29 @@ export class Plugin<T> implements theia.Plugin<T> {
|
|
|
1442
1448
|
}
|
|
1443
1449
|
|
|
1444
1450
|
get isActive(): boolean {
|
|
1445
|
-
return this
|
|
1451
|
+
return this.#pluginManager.isActive(this.id);
|
|
1446
1452
|
}
|
|
1447
1453
|
|
|
1448
1454
|
get exports(): T {
|
|
1449
|
-
return <T>this
|
|
1455
|
+
return <T>this.#pluginManager.getPluginExport(this.id);
|
|
1450
1456
|
}
|
|
1451
1457
|
|
|
1452
1458
|
activate(): PromiseLike<T> {
|
|
1453
|
-
return this
|
|
1459
|
+
return this.#pluginManager.activatePlugin(this.id).then(() => this.exports);
|
|
1454
1460
|
}
|
|
1455
1461
|
}
|
|
1456
1462
|
|
|
1457
1463
|
export class PluginExt<T> extends Plugin<T> implements ExtensionPlugin<T> {
|
|
1464
|
+
#pluginManager: PluginManager;
|
|
1465
|
+
|
|
1458
1466
|
extensionPath: string;
|
|
1459
1467
|
extensionUri: theia.Uri;
|
|
1460
1468
|
extensionKind: ExtensionKind;
|
|
1461
1469
|
isFromDifferentExtensionHost: boolean;
|
|
1462
1470
|
|
|
1463
|
-
constructor(
|
|
1471
|
+
constructor(pluginManager: PluginManager, plugin: InternalPlugin, isFromDifferentExtensionHost = false) {
|
|
1464
1472
|
super(pluginManager, plugin);
|
|
1473
|
+
this.#pluginManager = pluginManager;
|
|
1465
1474
|
|
|
1466
1475
|
this.extensionPath = this.pluginPath;
|
|
1467
1476
|
this.extensionUri = this.pluginUri;
|
|
@@ -1470,14 +1479,14 @@ export class PluginExt<T> extends Plugin<T> implements ExtensionPlugin<T> {
|
|
|
1470
1479
|
}
|
|
1471
1480
|
|
|
1472
1481
|
override get isActive(): boolean {
|
|
1473
|
-
return this
|
|
1482
|
+
return this.#pluginManager.isActive(this.id);
|
|
1474
1483
|
}
|
|
1475
1484
|
|
|
1476
1485
|
override get exports(): T {
|
|
1477
|
-
return <T>this
|
|
1486
|
+
return <T>this.#pluginManager.getPluginExport(this.id);
|
|
1478
1487
|
}
|
|
1479
1488
|
|
|
1480
1489
|
override activate(): PromiseLike<T> {
|
|
1481
|
-
return this
|
|
1490
|
+
return this.#pluginManager.activatePlugin(this.id).then(() => this.exports);
|
|
1482
1491
|
}
|
|
1483
1492
|
}
|
|
@@ -43,6 +43,7 @@ import { WebviewsExtImpl } from './webviews';
|
|
|
43
43
|
import { URI as Uri } from './types-impl';
|
|
44
44
|
import { SecretsExtImpl, SecretStorageExt } from '../plugin/secrets-ext';
|
|
45
45
|
import { PluginExt } from './plugin-context';
|
|
46
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
46
47
|
|
|
47
48
|
export interface PluginHost {
|
|
48
49
|
|
|
@@ -96,7 +97,9 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
|
|
|
96
97
|
'onFileSystem',
|
|
97
98
|
'onCustomEditor',
|
|
98
99
|
'onStartupFinished',
|
|
99
|
-
'onAuthenticationRequest'
|
|
100
|
+
'onAuthenticationRequest',
|
|
101
|
+
'onNotebook',
|
|
102
|
+
'onNotebookSerializer'
|
|
100
103
|
]);
|
|
101
104
|
|
|
102
105
|
private configStorage: ConfigStorage | undefined;
|
|
@@ -115,6 +118,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
|
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
protected jsonValidation: PluginJsonValidationContribution[] = [];
|
|
121
|
+
protected ready = new Deferred();
|
|
118
122
|
|
|
119
123
|
constructor(
|
|
120
124
|
private readonly host: PluginHost,
|
|
@@ -230,6 +234,8 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
|
|
|
230
234
|
this.registerPlugin(plugin);
|
|
231
235
|
}
|
|
232
236
|
|
|
237
|
+
// ensure plugins are registered before running activation events
|
|
238
|
+
this.ready.resolve();
|
|
233
239
|
// run eager plugins
|
|
234
240
|
await this.$activateByEvent('*');
|
|
235
241
|
for (const activationEvent of params.activationEvents) {
|
|
@@ -333,6 +339,8 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
|
|
|
333
339
|
}
|
|
334
340
|
|
|
335
341
|
async $activateByEvent(activationEvent: string): Promise<void> {
|
|
342
|
+
// Prevent the plugin manager from performing activations before plugins are registered
|
|
343
|
+
await this.ready.promise;
|
|
336
344
|
if (activationEvent.endsWith(':*')) {
|
|
337
345
|
const baseEvent = activationEvent.substring(0, activationEvent.length - 2);
|
|
338
346
|
await this.activateByBaseEvent(baseEvent);
|
package/src/plugin/quick-open.ts
CHANGED
|
@@ -655,6 +655,7 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
655
655
|
pickItems.push({
|
|
656
656
|
kind: item.kind,
|
|
657
657
|
label: item.label,
|
|
658
|
+
iconPath: item.iconPath ? getIconUris(item.iconPath) : undefined,
|
|
658
659
|
description: item.description,
|
|
659
660
|
handle,
|
|
660
661
|
detail: item.detail,
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as theia from '@theia/plugin';
|
|
18
|
-
import * as Converter from '../type-converters';
|
|
19
18
|
import { TaskDto } from '../../common';
|
|
19
|
+
import * as Converter from '../type-converters';
|
|
20
20
|
|
|
21
21
|
export class TaskProviderAdapter {
|
|
22
22
|
|
|
23
23
|
constructor(private readonly provider: theia.TaskProvider) { }
|
|
24
24
|
|
|
25
|
-
provideTasks(token: theia.CancellationToken): Promise<TaskDto[]
|
|
25
|
+
provideTasks(token: theia.CancellationToken): Promise<TaskDto[]> {
|
|
26
26
|
return Promise.resolve(this.provider.provideTasks(token)).then(tasks => {
|
|
27
27
|
if (!Array.isArray(tasks)) {
|
|
28
|
-
return
|
|
28
|
+
return [];
|
|
29
29
|
}
|
|
30
30
|
const result: TaskDto[] = [];
|
|
31
31
|
for (const task of tasks) {
|
|
@@ -40,21 +40,18 @@ export class TaskProviderAdapter {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
resolveTask(task: TaskDto, token: theia.CancellationToken): Promise<TaskDto
|
|
43
|
+
async resolveTask(task: TaskDto, token: theia.CancellationToken): Promise<TaskDto> {
|
|
44
44
|
if (typeof this.provider.resolveTask !== 'function') {
|
|
45
|
-
return
|
|
45
|
+
return task;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const item = Converter.toTask(task);
|
|
49
49
|
if (!item) {
|
|
50
|
-
return
|
|
50
|
+
return task;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
return undefined;
|
|
58
|
-
});
|
|
53
|
+
const resolved = await this.provider.resolveTask(item, token);
|
|
54
|
+
const converted = resolved ? Converter.fromTask(resolved) : Converter.fromTask(item);
|
|
55
|
+
return converted ?? task;
|
|
59
56
|
}
|
|
60
57
|
}
|
|
@@ -158,37 +158,42 @@ export class TasksExtImpl implements TasksExt {
|
|
|
158
158
|
throw new Error('Task was not successfully transformed into a task config');
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
$provideTasks(handle: number): Promise<TaskDto[]
|
|
161
|
+
async $provideTasks(handle: number): Promise<TaskDto[]> {
|
|
162
162
|
const adapter = this.adaptersMap.get(handle);
|
|
163
163
|
if (adapter) {
|
|
164
164
|
return adapter.provideTasks(CancellationToken.None).then(tasks => {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
task.executionId = this.addCustomExecution(task.callback);
|
|
169
|
-
task.callback = undefined;
|
|
170
|
-
}
|
|
165
|
+
for (const task of tasks) {
|
|
166
|
+
if (task.taskType === 'customExecution') {
|
|
167
|
+
this.applyCustomExecution(task);
|
|
171
168
|
}
|
|
172
169
|
}
|
|
173
170
|
return tasks;
|
|
174
171
|
});
|
|
175
172
|
} else {
|
|
176
|
-
|
|
173
|
+
throw new Error('No adapter found to provide tasks');
|
|
177
174
|
}
|
|
178
175
|
}
|
|
179
176
|
|
|
180
|
-
$resolveTask(handle: number, task: TaskDto, token: theia.CancellationToken): Promise<TaskDto
|
|
177
|
+
async $resolveTask(handle: number, task: TaskDto, token: theia.CancellationToken): Promise<TaskDto> {
|
|
181
178
|
const adapter = this.adaptersMap.get(handle);
|
|
182
179
|
if (adapter) {
|
|
183
180
|
return adapter.resolveTask(task, token).then(resolvedTask => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
// ensure we do not lose task type and execution id during resolution as we need it for custom execution
|
|
182
|
+
resolvedTask.taskType = resolvedTask.taskType ?? task.taskType;
|
|
183
|
+
if (resolvedTask.taskType === 'customExecution') {
|
|
184
|
+
this.applyCustomExecution(resolvedTask);
|
|
187
185
|
}
|
|
188
186
|
return resolvedTask;
|
|
189
187
|
});
|
|
190
188
|
} else {
|
|
191
|
-
|
|
189
|
+
throw new Error('No adapter found to resolve task');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private applyCustomExecution(task: TaskDto): void {
|
|
194
|
+
if (task.callback) {
|
|
195
|
+
task.executionId = this.addCustomExecution(task.callback);
|
|
196
|
+
task.callback = undefined;
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
|
|
@@ -20,6 +20,7 @@ import { RPCProtocol } from '../common/rpc-protocol';
|
|
|
20
20
|
import { Event, Emitter } from '@theia/core/lib/common/event';
|
|
21
21
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
22
22
|
import * as theia from '@theia/plugin';
|
|
23
|
+
import * as Converter from './type-converters';
|
|
23
24
|
import { Disposable, EnvironmentVariableMutatorType, TerminalExitReason, ThemeIcon } from './types-impl';
|
|
24
25
|
import { SerializableEnvironmentVariableCollection } from '@theia/terminal/lib/common/base-terminal-protocol';
|
|
25
26
|
import { ProvidedTerminalLink } from '../common/plugin-api-rpc-model';
|
|
@@ -313,7 +314,11 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
|
|
|
313
314
|
|
|
314
315
|
private syncEnvironmentVariableCollection(extensionIdentifier: string, collection: EnvironmentVariableCollection): void {
|
|
315
316
|
const serialized = [...collection.map.entries()];
|
|
316
|
-
this.proxy.$setEnvironmentVariableCollection(
|
|
317
|
+
this.proxy.$setEnvironmentVariableCollection(collection.persistent, {
|
|
318
|
+
extensionIdentifier,
|
|
319
|
+
collection: serialized.length === 0 ? undefined : serialized,
|
|
320
|
+
description: Converter.fromMarkdownOrString(collection.description)
|
|
321
|
+
});
|
|
317
322
|
}
|
|
318
323
|
|
|
319
324
|
private setEnvironmentVariableCollection(extensionIdentifier: string, collection: EnvironmentVariableCollection): void {
|
|
@@ -339,8 +344,15 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
|
|
|
339
344
|
|
|
340
345
|
export class EnvironmentVariableCollection implements theia.EnvironmentVariableCollection {
|
|
341
346
|
readonly map: Map<string, theia.EnvironmentVariableMutator> = new Map();
|
|
347
|
+
private _description?: string | theia.MarkdownString;
|
|
342
348
|
private _persistent: boolean = true;
|
|
343
349
|
|
|
350
|
+
public get description(): string | theia.MarkdownString | undefined { return this._description; }
|
|
351
|
+
public set description(value: string | theia.MarkdownString | undefined) {
|
|
352
|
+
this._description = value;
|
|
353
|
+
this.onDidChangeCollectionEmitter.fire();
|
|
354
|
+
}
|
|
355
|
+
|
|
344
356
|
public get persistent(): boolean { return this._persistent; }
|
|
345
357
|
public set persistent(value: boolean) {
|
|
346
358
|
this._persistent = value;
|