@theia/plugin-ext 1.46.1 → 1.47.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/index.js +4 -13
- package/lib/common/index.js.map +1 -1
- package/lib/common/plugin-api-rpc-model.d.ts +1 -1
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +41 -20
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +10 -0
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/common/uri-components.d.ts +1 -2
- package/lib/common/uri-components.d.ts.map +1 -1
- package/lib/common/uri-components.js +1 -5
- package/lib/common/uri-components.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.js +2 -7
- package/lib/hosted/browser/hosted-plugin-watcher.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +59 -67
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/plugin-worker.js +3 -11
- package/lib/hosted/browser/plugin-worker.js.map +1 -1
- package/lib/hosted/browser/worker/worker-env-ext.js +3 -11
- package/lib/hosted/browser/worker/worker-env-ext.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.js +21 -29
- package/lib/hosted/common/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-cli-contribution.js +2 -7
- package/lib/hosted/node/hosted-plugin-cli-contribution.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +14 -22
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +8 -16
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +14 -22
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.js +12 -20
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/metadata-scanner.js +6 -17
- package/lib/hosted/node/metadata-scanner.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +42 -53
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-language-pack-service.js +2 -7
- package/lib/hosted/node/plugin-language-pack-service.js.map +1 -1
- package/lib/hosted/node/plugin-reader.js +8 -16
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/plugin-service.js +22 -33
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/file-plugin-uri-factory.js +2 -7
- package/lib/hosted/node/scanners/file-plugin-uri-factory.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +2 -7
- package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +17 -19
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/hosted/node-electron/scanner-theia-electron.js +2 -7
- package/lib/hosted/node-electron/scanner-theia-electron.js.map +1 -1
- package/lib/main/browser/command-registry-main.d.ts +1 -0
- package/lib/main/browser/command-registry-main.d.ts.map +1 -1
- package/lib/main/browser/command-registry-main.js +6 -1
- package/lib/main/browser/command-registry-main.js.map +1 -1
- package/lib/main/browser/commands.js +5 -16
- package/lib/main/browser/commands.js.map +1 -1
- package/lib/main/browser/comments/comments-context-key-service.js +8 -16
- package/lib/main/browser/comments/comments-context-key-service.js.map +1 -1
- package/lib/main/browser/comments/comments-contribution.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-contribution.js +17 -25
- package/lib/main/browser/comments/comments-contribution.js.map +1 -1
- package/lib/main/browser/comments/comments-decorator.js +3 -11
- package/lib/main/browser/comments/comments-decorator.js.map +1 -1
- package/lib/main/browser/comments/comments-main.js +2 -2
- package/lib/main/browser/comments/comments-main.js.map +1 -1
- package/lib/main/browser/comments/comments-service.js +2 -7
- package/lib/main/browser/comments/comments-service.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-contribution.js +4 -12
- package/lib/main/browser/custom-editors/custom-editor-contribution.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +7 -18
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-service.js +2 -7
- package/lib/main/browser/custom-editors/custom-editor-service.js.map +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 +15 -21
- package/lib/main/browser/custom-editors/custom-editor-widget.js.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/custom-editors/plugin-custom-editor-registry.js +18 -26
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts +2 -2
- package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts.map +1 -1
- package/lib/main/browser/data-transfer/data-transfer-type-converters.js +2 -4
- package/lib/main/browser/data-transfer/data-transfer-type-converters.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.js +10 -18
- package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +8 -16
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
- package/lib/main/browser/dialogs/modal-notification.js +3 -11
- package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts +5 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +22 -3
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/file-system-main-impl.d.ts +2 -1
- package/lib/main/browser/file-system-main-impl.d.ts.map +1 -1
- package/lib/main/browser/file-system-main-impl.js +5 -3
- package/lib/main/browser/file-system-main-impl.js.map +1 -1
- package/lib/main/browser/keybindings/keybindings-contribution-handler.js +4 -12
- package/lib/main/browser/keybindings/keybindings-contribution-handler.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +2 -2
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +19 -27
- 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 +1 -3
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +23 -31
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.js +20 -25
- package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
- package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +2 -2
- package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts.map +1 -1
- package/lib/main/browser/menus/vscode-theia-menu-mappings.js +11 -9
- package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +0 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +5 -7
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +1 -0
- package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-kernels-main.js +41 -4
- package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +7 -2
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +79 -45
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +1 -0
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js +74 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +10 -2
- package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
- package/lib/main/browser/output-channel-registry-main.js +4 -12
- package/lib/main/browser/output-channel-registry-main.js.map +1 -1
- package/lib/main/browser/plugin-authentication-service.js +3 -11
- package/lib/main/browser/plugin-authentication-service.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +66 -69
- 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 -1
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/plugin-ext-widget.js +11 -19
- package/lib/main/browser/plugin-ext-widget.js.map +1 -1
- package/lib/main/browser/plugin-frontend-contribution.js +4 -12
- package/lib/main/browser/plugin-frontend-contribution.js.map +1 -1
- package/lib/main/browser/plugin-frontend-view-contribution.js +3 -11
- package/lib/main/browser/plugin-frontend-view-contribution.js.map +1 -1
- package/lib/main/browser/plugin-icon-service.d.ts +2 -5
- package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-service.js +10 -77
- package/lib/main/browser/plugin-icon-service.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +22 -30
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +8 -16
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/plugin-terminal-registry.js +2 -7
- package/lib/main/browser/plugin-terminal-registry.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +8 -7
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/quick-open-main.js +51 -14
- package/lib/main/browser/quick-open-main.js.map +1 -1
- package/lib/main/browser/scm-main.js +3 -3
- package/lib/main/browser/scm-main.js.map +1 -1
- package/lib/main/browser/selection-provider-command.d.ts.map +1 -1
- package/lib/main/browser/selection-provider-command.js +5 -14
- package/lib/main/browser/selection-provider-command.js.map +1 -1
- package/lib/main/browser/test-main.d.ts +3 -1
- package/lib/main/browser/test-main.d.ts.map +1 -1
- package/lib/main/browser/test-main.js +29 -30
- package/lib/main/browser/test-main.js.map +1 -1
- package/lib/main/browser/text-editor-model-service.js +5 -16
- package/lib/main/browser/text-editor-model-service.js.map +1 -1
- package/lib/main/browser/text-editors-main.d.ts +4 -5
- package/lib/main/browser/text-editors-main.d.ts.map +1 -1
- package/lib/main/browser/text-editors-main.js +15 -9
- package/lib/main/browser/text-editors-main.js.map +1 -1
- package/lib/main/browser/theme-icon-override.js +13 -19
- package/lib/main/browser/theme-icon-override.js.map +1 -1
- package/lib/main/browser/view/dnd-file-content-store.js +2 -7
- package/lib/main/browser/view/dnd-file-content-store.js.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +8 -16
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +49 -44
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.js +16 -25
- package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.js +6 -17
- package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +41 -50
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/view/view-context-key-service.js +8 -16
- package/lib/main/browser/view/view-context-key-service.js.map +1 -1
- package/lib/main/browser/view-column-service.js +4 -15
- package/lib/main/browser/view-column-service.js.map +1 -1
- package/lib/main/browser/webview/webview-context-keys.js +10 -18
- package/lib/main/browser/webview/webview-context-keys.js.map +1 -1
- package/lib/main/browser/webview/webview-environment.js +8 -16
- package/lib/main/browser/webview/webview-environment.js.map +1 -1
- package/lib/main/browser/webview/webview-frontend-security-warnings.js +8 -16
- package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
- package/lib/main/browser/webview/webview-resource-cache.js +3 -11
- package/lib/main/browser/webview/webview-resource-cache.js.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js +14 -22
- package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
- package/lib/main/browser/webview/webview.js +37 -45
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.js +3 -11
- package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
- package/lib/main/browser/workspace-main.js +2 -7
- package/lib/main/browser/workspace-main.js.map +1 -1
- package/lib/main/common/plugin-theia-environment.js +4 -12
- package/lib/main/common/plugin-theia-environment.js.map +1 -1
- package/lib/main/node/errors.spec.js +2 -2
- package/lib/main/node/errors.spec.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +6 -14
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +5 -13
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +10 -18
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-cli-contribution.js +2 -7
- package/lib/main/node/plugin-cli-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-contribution.js +6 -14
- package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +18 -26
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js +3 -11
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js.map +1 -1
- package/lib/main/node/plugin-github-resolver.js +5 -13
- package/lib/main/node/plugin-github-resolver.js.map +1 -1
- package/lib/main/node/plugin-http-resolver.js +5 -13
- package/lib/main/node/plugin-http-resolver.js.map +1 -1
- package/lib/main/node/plugin-localization-server.js +4 -12
- package/lib/main/node/plugin-localization-server.js.map +1 -1
- package/lib/main/node/plugin-mgmt-cli-contribution.js +4 -12
- package/lib/main/node/plugin-mgmt-cli-contribution.js.map +1 -1
- package/lib/main/node/plugin-server-handler.js +6 -14
- package/lib/main/node/plugin-server-handler.js.map +1 -1
- package/lib/main/node/plugin-service.js +10 -18
- package/lib/main/node/plugin-service.js.map +1 -1
- package/lib/main/node/plugin-theia-deployer-participant.js +4 -12
- package/lib/main/node/plugin-theia-deployer-participant.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.js +2 -7
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +12 -20
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js +2 -7
- package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +2 -7
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.js +2 -7
- package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
- package/lib/plugin/clipboard-ext.js +8 -16
- package/lib/plugin/clipboard-ext.js.map +1 -1
- package/lib/plugin/custom-editors.js +1 -1
- package/lib/plugin/custom-editors.js.map +1 -1
- package/lib/plugin/debug/debug-ext.js +11 -19
- package/lib/plugin/debug/debug-ext.js.map +1 -1
- package/lib/plugin/editors-and-documents.js +4 -12
- package/lib/plugin/editors-and-documents.js.map +1 -1
- package/lib/plugin/env.js +12 -20
- package/lib/plugin/env.js.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +2 -1
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +13 -1
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/known-commands.d.ts.map +1 -1
- package/lib/plugin/known-commands.js +1 -0
- package/lib/plugin/known-commands.js.map +1 -1
- package/lib/plugin/languages/diagnostics.js +2 -2
- package/lib/plugin/languages/diagnostics.js.map +1 -1
- package/lib/plugin/languages/link-provider.d.ts.map +1 -1
- package/lib/plugin/languages/link-provider.js +3 -1
- package/lib/plugin/languages/link-provider.js.map +1 -1
- package/lib/plugin/localization-ext.js +8 -16
- package/lib/plugin/localization-ext.js.map +1 -1
- package/lib/plugin/markdown-string.d.ts +3 -3
- package/lib/plugin/markdown-string.d.ts.map +1 -1
- package/lib/plugin/markdown-string.js +17 -36
- package/lib/plugin/markdown-string.js.map +1 -1
- package/lib/plugin/message-registry.js +8 -16
- package/lib/plugin/message-registry.js.map +1 -1
- package/lib/plugin/node/env-node-ext.js +5 -13
- package/lib/plugin/node/env-node-ext.js.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts +5 -6
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.js +24 -23
- package/lib/plugin/notebook/notebook-kernels.js.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.js.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +1 -0
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +19 -0
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +18 -21
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.js +23 -31
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/plugin-storage.js +4 -15
- package/lib/plugin/plugin-storage.js.map +1 -1
- package/lib/plugin/preference-registry.js +12 -20
- package/lib/plugin/preference-registry.js.map +1 -1
- package/lib/plugin/quick-open.d.ts +2 -9
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +6 -22
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/secrets-ext.js +4 -15
- package/lib/plugin/secrets-ext.js.map +1 -1
- package/lib/plugin/terminal-ext.js +6 -17
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/test-item.js +17 -25
- package/lib/plugin/test-item.js.map +1 -1
- package/lib/plugin/tests.d.ts +8 -1
- package/lib/plugin/tests.d.ts.map +1 -1
- package/lib/plugin/tests.js +35 -21
- package/lib/plugin/tests.js.map +1 -1
- package/lib/plugin/text-editors.d.ts +2 -0
- package/lib/plugin/text-editors.d.ts.map +1 -1
- package/lib/plugin/text-editors.js +6 -0
- package/lib/plugin/text-editors.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +10 -1
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +49 -10
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +2 -2
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +167 -180
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/webviews.d.ts +14 -1
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/webviews.js +32 -24
- package/lib/plugin/webviews.js.map +1 -1
- package/lib/plugin/workspace.js +12 -20
- package/lib/plugin/workspace.js.map +1 -1
- package/package.json +31 -31
- package/src/common/plugin-api-rpc-model.ts +1 -1
- package/src/common/plugin-api-rpc.ts +36 -20
- package/src/common/plugin-protocol.ts +12 -1
- package/src/common/uri-components.ts +1 -5
- package/src/hosted/browser/hosted-plugin.ts +2 -2
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +2 -2
- package/src/hosted/node/scanners/scanner-theia.ts +8 -2
- package/src/main/browser/command-registry-main.ts +7 -0
- package/src/main/browser/comments/comments-contribution.ts +7 -3
- package/src/main/browser/comments/comments-main.ts +2 -2
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +2 -2
- package/src/main/browser/custom-editors/custom-editor-widget.ts +3 -1
- package/src/main/browser/custom-editors/custom-editors-main.ts +1 -1
- package/src/main/browser/data-transfer/data-transfer-type-converters.ts +4 -6
- package/src/main/browser/editors-and-documents-main.ts +27 -5
- package/src/main/browser/file-system-main-impl.ts +9 -5
- package/src/main/browser/languages-main.ts +9 -5
- package/src/main/browser/main-context.ts +1 -3
- package/src/main/browser/menus/menus-contribution-handler.ts +1 -1
- package/src/main/browser/menus/plugin-menu-command-adapter.ts +4 -1
- package/src/main/browser/menus/vscode-theia-menu-mappings.ts +10 -2
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +5 -8
- package/src/main/browser/notebooks/notebook-kernels-main.ts +46 -5
- package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +72 -21
- package/src/main/browser/notebooks/renderers/output-webview-internal.ts +93 -2
- package/src/main/browser/notebooks/renderers/webview-communication.ts +12 -2
- package/src/main/browser/plugin-contribution-handler.ts +9 -1
- package/src/main/browser/plugin-ext-frontend-module.ts +6 -2
- package/src/main/browser/plugin-icon-service.ts +8 -72
- package/src/main/browser/quick-open-main.ts +77 -28
- package/src/main/browser/scm-main.ts +1 -1
- package/src/main/browser/selection-provider-command.ts +1 -2
- package/src/main/browser/test-main.ts +11 -2
- package/src/main/browser/text-editors-main.ts +18 -10
- package/src/main/browser/theme-icon-override.ts +13 -19
- package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +1 -1
- package/src/main/browser/view/plugin-view-registry.ts +21 -6
- package/src/main/browser/view/plugin-view-widget.ts +0 -1
- package/src/main/browser/view/tree-view-widget.tsx +2 -3
- package/src/main/node/errors.spec.ts +2 -2
- package/src/plugin/custom-editors.ts +1 -1
- package/src/plugin/debug/debug-ext.ts +2 -2
- package/src/plugin/env.ts +3 -3
- package/src/plugin/file-system-ext-impl.ts +15 -2
- package/src/plugin/known-commands.ts +1 -0
- package/src/plugin/languages/diagnostics.ts +2 -2
- package/src/plugin/languages/link-provider.ts +3 -1
- package/src/plugin/markdown-string.ts +3 -3
- package/src/plugin/node/env-node-ext.ts +2 -2
- package/src/plugin/notebook/notebook-kernels.ts +29 -29
- package/src/plugin/notebook/notebook-renderers.ts +0 -1
- package/src/plugin/notebook/notebooks.ts +20 -0
- package/src/plugin/plugin-context.ts +12 -3
- package/src/plugin/preference-registry.ts +2 -2
- package/src/plugin/quick-open.ts +10 -24
- package/src/plugin/terminal-ext.ts +1 -1
- package/src/plugin/tests.ts +33 -4
- package/src/plugin/text-editors.ts +9 -2
- package/src/plugin/type-converters.ts +45 -9
- package/src/plugin/types-impl.ts +4 -4
- package/src/plugin/webviews.ts +22 -5
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { IDataTransferItem,
|
|
17
|
+
import { IDataTransferItem, IReadonlyVSDataTransfer } from '@theia/monaco-editor-core/esm/vs/base/common/dataTransfer';
|
|
18
18
|
import { DataTransferDTO, DataTransferItemDTO } from '../../../common/plugin-api-rpc-model';
|
|
19
19
|
import { URI } from '../../../plugin/types-impl';
|
|
20
20
|
|
|
@@ -24,7 +24,6 @@ export namespace DataTransferItem {
|
|
|
24
24
|
|
|
25
25
|
if (mime === 'text/uri-list') {
|
|
26
26
|
return {
|
|
27
|
-
id: item.id,
|
|
28
27
|
asString: '',
|
|
29
28
|
fileData: undefined,
|
|
30
29
|
uriListData: serializeUriList(stringValue),
|
|
@@ -33,9 +32,8 @@ export namespace DataTransferItem {
|
|
|
33
32
|
|
|
34
33
|
const fileValue = item.asFile();
|
|
35
34
|
return {
|
|
36
|
-
id: item.id,
|
|
37
35
|
asString: stringValue,
|
|
38
|
-
fileData: fileValue ? { name: fileValue.name, uri: fileValue.uri } : undefined,
|
|
36
|
+
fileData: fileValue ? { id: fileValue.id, name: fileValue.name, uri: fileValue.uri } : undefined,
|
|
39
37
|
};
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -57,10 +55,10 @@ export namespace DataTransferItem {
|
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
export namespace DataTransfer {
|
|
60
|
-
export async function toDataTransferDTO(value:
|
|
58
|
+
export async function toDataTransferDTO(value: IReadonlyVSDataTransfer): Promise<DataTransferDTO> {
|
|
61
59
|
return {
|
|
62
60
|
items: await Promise.all(
|
|
63
|
-
Array.from(value
|
|
61
|
+
Array.from(value)
|
|
64
62
|
.map(
|
|
65
63
|
async ([mime, item]) => [mime, await DataTransferItem.from(mime, item)]
|
|
66
64
|
)
|
|
@@ -30,8 +30,9 @@ import { EditorModelService } from './text-editor-model-service';
|
|
|
30
30
|
import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
|
|
31
31
|
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
|
|
32
32
|
import { TextEditorMain } from './text-editor-main';
|
|
33
|
-
import { DisposableCollection, Emitter } from '@theia/core';
|
|
33
|
+
import { DisposableCollection, Emitter, URI } from '@theia/core';
|
|
34
34
|
import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
|
|
35
|
+
import { SaveResourceService } from '@theia/core/lib/browser/save-resource-service';
|
|
35
36
|
|
|
36
37
|
export class EditorsAndDocumentsMain implements Disposable {
|
|
37
38
|
|
|
@@ -41,7 +42,8 @@ export class EditorsAndDocumentsMain implements Disposable {
|
|
|
41
42
|
private readonly textEditors = new Map<string, TextEditorMain>();
|
|
42
43
|
|
|
43
44
|
private readonly modelService: EditorModelService;
|
|
44
|
-
private readonly
|
|
45
|
+
private readonly editorManager: EditorManager;
|
|
46
|
+
private readonly saveResourceService: SaveResourceService;
|
|
45
47
|
|
|
46
48
|
private readonly onTextEditorAddEmitter = new Emitter<TextEditorMain[]>();
|
|
47
49
|
private readonly onTextEditorRemoveEmitter = new Emitter<string[]>();
|
|
@@ -60,10 +62,11 @@ export class EditorsAndDocumentsMain implements Disposable {
|
|
|
60
62
|
constructor(rpc: RPCProtocol, container: interfaces.Container) {
|
|
61
63
|
this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.EDITORS_AND_DOCUMENTS_EXT);
|
|
62
64
|
|
|
63
|
-
this.
|
|
65
|
+
this.editorManager = container.get(EditorManager);
|
|
64
66
|
this.modelService = container.get(EditorModelService);
|
|
67
|
+
this.saveResourceService = container.get(SaveResourceService);
|
|
65
68
|
|
|
66
|
-
this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d), this.
|
|
69
|
+
this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d), this.editorManager, this.modelService);
|
|
67
70
|
this.toDispose.push(this.stateComputer);
|
|
68
71
|
this.toDispose.push(this.onTextEditorAddEmitter);
|
|
69
72
|
this.toDispose.push(this.onTextEditorRemoveEmitter);
|
|
@@ -167,12 +170,31 @@ export class EditorsAndDocumentsMain implements Disposable {
|
|
|
167
170
|
return this.textEditors.get(id);
|
|
168
171
|
}
|
|
169
172
|
|
|
173
|
+
async save(uri: URI): Promise<URI | undefined> {
|
|
174
|
+
const editor = await this.editorManager.getByUri(uri);
|
|
175
|
+
if (!editor) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return this.saveResourceService.save(editor);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async saveAs(uri: URI): Promise<URI | undefined> {
|
|
182
|
+
const editor = await this.editorManager.getByUri(uri);
|
|
183
|
+
if (!editor) {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
if (!this.saveResourceService.canSaveAs(editor)) {
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
return this.saveResourceService.saveAs(editor);
|
|
190
|
+
}
|
|
191
|
+
|
|
170
192
|
saveAll(includeUntitled?: boolean): Promise<boolean> {
|
|
171
193
|
return this.modelService.saveAll(includeUntitled);
|
|
172
194
|
}
|
|
173
195
|
|
|
174
196
|
hideEditor(id: string): Promise<void> {
|
|
175
|
-
for (const editorWidget of this.
|
|
197
|
+
for (const editorWidget of this.editorManager.all) {
|
|
176
198
|
const monacoEditor = MonacoEditor.get(editorWidget);
|
|
177
199
|
if (monacoEditor) {
|
|
178
200
|
if (id === new EditorSnapshot(monacoEditor).id) {
|
|
@@ -35,9 +35,10 @@ import { UriComponents } from '../../common/uri-components';
|
|
|
35
35
|
import {
|
|
36
36
|
FileSystemProviderCapabilities, Stat, FileType, FileSystemProviderErrorCode, FileOverwriteOptions, FileDeleteOptions, FileOpenOptions, FileWriteOptions, WatchOptions,
|
|
37
37
|
FileSystemProviderWithFileReadWriteCapability, FileSystemProviderWithOpenReadWriteCloseCapability, FileSystemProviderWithFileFolderCopyCapability,
|
|
38
|
-
FileStat, FileChange, FileOperationError, FileOperationResult
|
|
38
|
+
FileStat, FileChange, FileOperationError, FileOperationResult, ReadOnlyMessageFileSystemProvider
|
|
39
39
|
} from '@theia/filesystem/lib/common/files';
|
|
40
40
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
41
|
+
import { MarkdownString } from '../../common/plugin-api-rpc-model';
|
|
41
42
|
|
|
42
43
|
type IDisposable = Disposable;
|
|
43
44
|
|
|
@@ -66,8 +67,8 @@ export class FileSystemMainImpl implements FileSystemMain, Disposable {
|
|
|
66
67
|
this._disposables.dispose();
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
$registerFileSystemProvider(handle: number, scheme: string, capabilities: FileSystemProviderCapabilities): void {
|
|
70
|
-
this._fileProvider.set(handle, new RemoteFileSystemProvider(this._fileService, scheme, capabilities, handle, this._proxy));
|
|
70
|
+
$registerFileSystemProvider(handle: number, scheme: string, capabilities: FileSystemProviderCapabilities, readonlyMessage?: MarkdownString): void {
|
|
71
|
+
this._fileProvider.set(handle, new RemoteFileSystemProvider(this._fileService, scheme, capabilities, handle, this._proxy, readonlyMessage));
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
$unregisterProvider(handle: number): void {
|
|
@@ -163,7 +164,7 @@ export class FileSystemMainImpl implements FileSystemMain, Disposable {
|
|
|
163
164
|
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
class RemoteFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability, FileSystemProviderWithOpenReadWriteCloseCapability, FileSystemProviderWithFileFolderCopyCapability {
|
|
167
|
+
class RemoteFileSystemProvider implements FileSystemProviderWithFileReadWriteCapability, FileSystemProviderWithOpenReadWriteCloseCapability, FileSystemProviderWithFileFolderCopyCapability, ReadOnlyMessageFileSystemProvider {
|
|
167
168
|
|
|
168
169
|
private readonly _onDidChange = new Emitter<readonly FileChange[]>();
|
|
169
170
|
private readonly _registration: IDisposable;
|
|
@@ -174,12 +175,15 @@ class RemoteFileSystemProvider implements FileSystemProviderWithFileReadWriteCap
|
|
|
174
175
|
readonly capabilities: FileSystemProviderCapabilities;
|
|
175
176
|
readonly onDidChangeCapabilities: Event<void> = Event.None;
|
|
176
177
|
|
|
178
|
+
readonly onDidChangeReadOnlyMessage: Event<MarkdownString | undefined> = Event.None;
|
|
179
|
+
|
|
177
180
|
constructor(
|
|
178
181
|
fileService: FileService,
|
|
179
182
|
scheme: string,
|
|
180
183
|
capabilities: FileSystemProviderCapabilities,
|
|
181
184
|
private readonly _handle: number,
|
|
182
|
-
private readonly _proxy: FileSystemExt
|
|
185
|
+
private readonly _proxy: FileSystemExt,
|
|
186
|
+
public readonly readOnlyMessage: MarkdownString | undefined = undefined
|
|
183
187
|
) {
|
|
184
188
|
this.capabilities = capabilities;
|
|
185
189
|
this._registration = fileService.registerProvider(scheme, this);
|
|
@@ -42,7 +42,7 @@ import { injectable, inject } from '@theia/core/shared/inversify';
|
|
|
42
42
|
import {
|
|
43
43
|
SerializedDocumentFilter, MarkerData, Range, RelatedInformation,
|
|
44
44
|
MarkerSeverity, DocumentLink, WorkspaceSymbolParams, CodeAction, CompletionDto,
|
|
45
|
-
CodeActionProviderDocumentation, InlayHint, InlayHintLabelPart, CodeActionContext, DocumentDropEditProviderMetadata
|
|
45
|
+
CodeActionProviderDocumentation, InlayHint, InlayHintLabelPart, CodeActionContext, DocumentDropEditProviderMetadata, SignatureHelpContext
|
|
46
46
|
} from '../../common/plugin-api-rpc-model';
|
|
47
47
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
48
48
|
import { MonacoLanguages, WorkspaceSymbolProvider } from '@theia/monaco/lib/browser/monaco-languages';
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
85
85
|
import { CodeActionTriggerKind, SnippetString } from '../../plugin/types-impl';
|
|
86
86
|
import { DataTransfer } from './data-transfer/data-transfer-type-converters';
|
|
87
|
-
import {
|
|
87
|
+
import { IReadonlyVSDataTransfer } from '@theia/monaco-editor-core/esm/vs/base/common/dataTransfer';
|
|
88
88
|
import { FileUploadService } from '@theia/filesystem/lib/browser/file-upload-service';
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -647,7 +647,9 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
647
647
|
protected async provideSignatureHelp(handle: number, model: monaco.editor.ITextModel,
|
|
648
648
|
position: monaco.Position, token: monaco.CancellationToken,
|
|
649
649
|
context: monaco.languages.SignatureHelpContext): Promise<monaco.languages.ProviderResult<monaco.languages.SignatureHelpResult>> {
|
|
650
|
-
|
|
650
|
+
|
|
651
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
652
|
+
const value = await this.proxy.$provideSignatureHelp(handle, model.uri, position, context as SignatureHelpContext, token);
|
|
651
653
|
if (!value) {
|
|
652
654
|
return undefined;
|
|
653
655
|
}
|
|
@@ -749,7 +751,7 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
749
751
|
}
|
|
750
752
|
|
|
751
753
|
protected async provideDocumentDropEdits(handle: number, model: ITextModel, position: monaco.IPosition,
|
|
752
|
-
dataTransfer:
|
|
754
|
+
dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise<DocumentOnDropEdit | undefined> {
|
|
753
755
|
await this.fileUploadService.upload(new URI(), { source: dataTransfer, leaveInTemp: true });
|
|
754
756
|
const edit = await this.proxy.$provideDocumentDropEdits(handle, model.uri, position, await DataTransfer.toDataTransferDTO(dataTransfer), token);
|
|
755
757
|
if (edit) {
|
|
@@ -759,6 +761,7 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
759
761
|
// yieldTo: edit.yieldTo?.map(yTo => {
|
|
760
762
|
// return 'mimeType' in yTo ? yTo : { providerId: DocumentOnDropEditAdapter.toInternalProviderId(yTo.extensionId, yTo.providerId) };
|
|
761
763
|
// }),
|
|
764
|
+
label: 'no label',
|
|
762
765
|
insertText: edit.insertText instanceof SnippetString ? { snippet: edit.insertText.value } : edit.insertText,
|
|
763
766
|
additionalEdit: toMonacoWorkspaceEdit(edit?.additionalEdit)
|
|
764
767
|
};
|
|
@@ -888,7 +891,8 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
888
891
|
};
|
|
889
892
|
},
|
|
890
893
|
resolveInlayHint: async (hint, token): Promise<monaco.languages.InlayHint | undefined> => {
|
|
891
|
-
|
|
894
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
895
|
+
const dto: InlayHintDto = hint as InlayHintDto;
|
|
892
896
|
if (typeof dto.cacheId !== 'number') {
|
|
893
897
|
return hint;
|
|
894
898
|
}
|
|
@@ -45,7 +45,6 @@ import { EditorModelService } from './text-editor-model-service';
|
|
|
45
45
|
import { OpenerService } from '@theia/core/lib/browser/opener-service';
|
|
46
46
|
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
|
|
47
47
|
import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edit-service';
|
|
48
|
-
import { MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
|
|
49
48
|
import { MainFileSystemEventService } from './main-file-system-event-service';
|
|
50
49
|
import { LabelServiceMainImpl } from './label-service-main';
|
|
51
50
|
import { TimelineMainImpl } from './timeline-main';
|
|
@@ -115,8 +114,7 @@ export function setUpPluginApi(rpc: RPCProtocol, container: interfaces.Container
|
|
|
115
114
|
rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_KERNELS_MAIN, new NotebookKernelsMainImpl(rpc, container));
|
|
116
115
|
|
|
117
116
|
const bulkEditService = container.get(MonacoBulkEditService);
|
|
118
|
-
const
|
|
119
|
-
const editorsMain = new TextEditorsMainImpl(editorsAndDocuments, documentsMain, rpc, bulkEditService, monacoEditorService);
|
|
117
|
+
const editorsMain = new TextEditorsMainImpl(editorsAndDocuments, documentsMain, rpc, bulkEditService);
|
|
120
118
|
rpc.set(PLUGIN_RPC_CONTEXT.TEXT_EDITORS_MAIN, editorsMain);
|
|
121
119
|
|
|
122
120
|
// start listening only after all clients are subscribed to events
|
|
@@ -31,7 +31,7 @@ import { PluginMenuCommandAdapter, ReferenceCountingSet } from './plugin-menu-co
|
|
|
31
31
|
import { ContextKeyExpr } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
32
32
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
33
33
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
34
|
-
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/
|
|
34
|
+
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
|
|
35
35
|
|
|
36
36
|
@injectable()
|
|
37
37
|
export class MenusContributionPointHandler {
|
|
@@ -108,7 +108,10 @@ export class PluginMenuCommandAdapter implements MenuCommandAdapter {
|
|
|
108
108
|
['timeline/item/context', (...args) => this.toTimelineArgs(...args)],
|
|
109
109
|
['view/item/context', (...args) => this.toTreeArgs(...args)],
|
|
110
110
|
['view/title', noArgs],
|
|
111
|
-
['webview/context', firstArgOnly]
|
|
111
|
+
['webview/context', firstArgOnly],
|
|
112
|
+
['extension/context', noArgs],
|
|
113
|
+
['terminal/context', noArgs],
|
|
114
|
+
['terminal/title/context', noArgs],
|
|
112
115
|
]).forEach(([contributionPoint, adapter]) => {
|
|
113
116
|
if (adapter) {
|
|
114
117
|
const paths = codeToTheiaMappings.get(contributionPoint);
|
|
@@ -33,6 +33,7 @@ import { WEBVIEW_CONTEXT_MENU, WebviewWidget } from '../webview/webview';
|
|
|
33
33
|
import { EDITOR_LINENUMBER_CONTEXT_MENU } from '@theia/editor/lib/browser/editor-linenumber-contribution';
|
|
34
34
|
import { TEST_VIEW_CONTEXT_MENU } from '@theia/test/lib/browser/view/test-view-contribution';
|
|
35
35
|
import { TEST_RUNS_CONTEXT_MENU } from '@theia/test/lib/browser/view/test-run-view-contribution';
|
|
36
|
+
import { TerminalMenus } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
|
36
37
|
|
|
37
38
|
export const PLUGIN_EDITOR_TITLE_MENU = ['plugin_editor/title'];
|
|
38
39
|
export const PLUGIN_EDITOR_TITLE_RUN_MENU = ['plugin_editor/title/run'];
|
|
@@ -61,7 +62,10 @@ export const implementedVSCodeContributionPoints = [
|
|
|
61
62
|
'testing/message/context',
|
|
62
63
|
'view/item/context',
|
|
63
64
|
'view/title',
|
|
64
|
-
'webview/context'
|
|
65
|
+
'webview/context',
|
|
66
|
+
'extension/context',
|
|
67
|
+
'terminal/context',
|
|
68
|
+
'terminal/title/context'
|
|
65
69
|
] as const;
|
|
66
70
|
|
|
67
71
|
export type ContributionPoint = (typeof implementedVSCodeContributionPoints)[number];
|
|
@@ -89,7 +93,11 @@ export const codeToTheiaMappings = new Map<ContributionPoint, MenuPath[]>([
|
|
|
89
93
|
['timeline/item/context', [TIMELINE_ITEM_CONTEXT_MENU]],
|
|
90
94
|
['view/item/context', [VIEW_ITEM_CONTEXT_MENU]],
|
|
91
95
|
['view/title', [PLUGIN_VIEW_TITLE_MENU]],
|
|
92
|
-
['webview/context', [WEBVIEW_CONTEXT_MENU]]
|
|
96
|
+
['webview/context', [WEBVIEW_CONTEXT_MENU]],
|
|
97
|
+
['extension/context', [['extensions_context_menu', '3_contribution']]],
|
|
98
|
+
['terminal/context', [TerminalMenus.TERMINAL_CONTRIBUTIONS]],
|
|
99
|
+
['terminal/title/context', [TerminalMenus.TERMINAL_TITLE_CONTRIBUTIONS]]
|
|
100
|
+
|
|
93
101
|
]);
|
|
94
102
|
|
|
95
103
|
type CodeEditorWidget = EditorWidget | WebviewWidget;
|
|
@@ -31,7 +31,6 @@ import { NotebookEditorsMainImpl } from './notebook-editors-main';
|
|
|
31
31
|
import { NotebookDocumentsMainImpl } from './notebook-documents-main';
|
|
32
32
|
import { diffMaps, diffSets } from '../../../common/collections';
|
|
33
33
|
import { Mutex } from 'async-mutex';
|
|
34
|
-
import throttle = require('@theia/core/shared/lodash.throttle');
|
|
35
34
|
|
|
36
35
|
interface NotebookAndEditorDelta {
|
|
37
36
|
removedDocuments: UriComponents[];
|
|
@@ -107,12 +106,12 @@ export class NotebooksAndEditorsMain implements NotebookDocumentsAndEditorsMain
|
|
|
107
106
|
this.notebookEditorService = container.get(NotebookEditorWidgetService);
|
|
108
107
|
this.WidgetManager = container.get(WidgetManager);
|
|
109
108
|
|
|
110
|
-
this.notebookService.onDidAddNotebookDocument(async () => this.
|
|
111
|
-
this.notebookService.onDidRemoveNotebookDocument(async () => this.
|
|
109
|
+
this.notebookService.onDidAddNotebookDocument(async () => this.updateState(), this, this.disposables);
|
|
110
|
+
this.notebookService.onDidRemoveNotebookDocument(async () => this.updateState(), this, this.disposables);
|
|
112
111
|
// this.WidgetManager.onActiveEditorChanged(() => this.updateState(), this, this.disposables);
|
|
113
112
|
this.notebookEditorService.onDidAddNotebookEditor(async editor => this.handleEditorAdd(editor), this, this.disposables);
|
|
114
113
|
this.notebookEditorService.onDidRemoveNotebookEditor(async editor => this.handleEditorRemove(editor), this, this.disposables);
|
|
115
|
-
this.notebookEditorService.onDidChangeFocusedEditor(async editor => this.
|
|
114
|
+
this.notebookEditorService.onDidChangeFocusedEditor(async editor => this.updateState(editor), this, this.disposables);
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
dispose(): void {
|
|
@@ -130,18 +129,16 @@ export class NotebooksAndEditorsMain implements NotebookDocumentsAndEditorsMain
|
|
|
130
129
|
} else {
|
|
131
130
|
this.editorListeners.set(editor.id, [disposable]);
|
|
132
131
|
}
|
|
133
|
-
await this.
|
|
132
|
+
await this.updateState();
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
private handleEditorRemove(editor: NotebookEditorWidget): void {
|
|
137
136
|
const listeners = this.editorListeners.get(editor.id);
|
|
138
137
|
listeners?.forEach(listener => listener.dispose());
|
|
139
138
|
this.editorListeners.delete(editor.id);
|
|
140
|
-
this.
|
|
139
|
+
this.updateState();
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
private throttleStateUpdate = throttle((focusedEditor?: NotebookEditorWidget) => this.updateState(focusedEditor), 100);
|
|
144
|
-
|
|
145
142
|
private async updateState(focusedEditor?: NotebookEditorWidget): Promise<void> {
|
|
146
143
|
await this.updateMutex.runExclusive(async () => this.doUpdateState(focusedEditor));
|
|
147
144
|
}
|
|
@@ -23,7 +23,10 @@ import { UriComponents } from '@theia/core/lib/common/uri';
|
|
|
23
23
|
import { LanguageService } from '@theia/core/lib/browser/language-service';
|
|
24
24
|
import { CellExecuteUpdateDto, CellExecutionCompleteDto, MAIN_RPC_CONTEXT, NotebookKernelDto, NotebookKernelsExt, NotebookKernelsMain } from '../../../common';
|
|
25
25
|
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
CellExecution, NotebookEditorWidgetService, NotebookExecutionStateService,
|
|
28
|
+
NotebookKernelChangeEvent, NotebookKernelService, NotebookService
|
|
29
|
+
} from '@theia/notebook/lib/browser';
|
|
27
30
|
import { combinedDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
|
|
28
31
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
29
32
|
import { NotebookKernelSourceAction } from '@theia/notebook/lib/common';
|
|
@@ -54,7 +57,7 @@ abstract class NotebookKernel {
|
|
|
54
57
|
return this.preloads.map(p => p.provides).flat();
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
constructor(data: NotebookKernelDto, private languageService: LanguageService) {
|
|
60
|
+
constructor(public readonly handle: number, data: NotebookKernelDto, private languageService: LanguageService) {
|
|
58
61
|
this.id = data.id;
|
|
59
62
|
this.viewType = data.notebookType;
|
|
60
63
|
this.extensionId = data.extensionId;
|
|
@@ -65,6 +68,7 @@ abstract class NotebookKernel {
|
|
|
65
68
|
this.detail = data.detail;
|
|
66
69
|
this.supportedLanguages = (data.supportedLanguages && data.supportedLanguages.length > 0) ? data.supportedLanguages : languageService.languages.map(lang => lang.id);
|
|
67
70
|
this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
|
|
71
|
+
this.localResourceRoot = URI.fromComponents(data.extensionLocation);
|
|
68
72
|
this.preloads = data.preloads?.map(u => ({ uri: URI.fromComponents(u.uri), provides: u.provides })) ?? [];
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -125,6 +129,7 @@ export class NotebookKernelsMainImpl implements NotebookKernelsMain {
|
|
|
125
129
|
private notebookService: NotebookService;
|
|
126
130
|
private languageService: LanguageService;
|
|
127
131
|
private notebookExecutionStateService: NotebookExecutionStateService;
|
|
132
|
+
private notebookEditorWidgetService: NotebookEditorWidgetService;
|
|
128
133
|
|
|
129
134
|
private readonly executions = new Map<number, CellExecution>();
|
|
130
135
|
|
|
@@ -138,10 +143,46 @@ export class NotebookKernelsMainImpl implements NotebookKernelsMain {
|
|
|
138
143
|
this.notebookExecutionStateService = container.get(NotebookExecutionStateService);
|
|
139
144
|
this.notebookService = container.get(NotebookService);
|
|
140
145
|
this.languageService = container.get(LanguageService);
|
|
146
|
+
this.notebookEditorWidgetService = container.get(NotebookEditorWidgetService);
|
|
147
|
+
|
|
148
|
+
this.notebookEditorWidgetService.onDidAddNotebookEditor(editor => {
|
|
149
|
+
editor.onDidRecieveKernelMessage(async message => {
|
|
150
|
+
const kernel = this.notebookKernelService.getSelectedOrSuggestedKernel(editor.model!);
|
|
151
|
+
if (kernel) {
|
|
152
|
+
this.proxy.$acceptKernelMessageFromRenderer(kernel.handle, editor.id, message);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
141
156
|
}
|
|
142
157
|
|
|
143
|
-
$postMessage(handle: number, editorId: string | undefined, message: unknown): Promise<boolean> {
|
|
144
|
-
|
|
158
|
+
async $postMessage(handle: number, editorId: string | undefined, message: unknown): Promise<boolean> {
|
|
159
|
+
const tuple = this.kernels.get(handle);
|
|
160
|
+
if (!tuple) {
|
|
161
|
+
throw new Error('kernel already disposed');
|
|
162
|
+
}
|
|
163
|
+
const [kernel] = tuple;
|
|
164
|
+
let didSend = false;
|
|
165
|
+
for (const editor of this.notebookEditorWidgetService.getNotebookEditors()) {
|
|
166
|
+
if (!editor.model) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (this.notebookKernelService.getMatchingKernel(editor.model).selected !== kernel) {
|
|
170
|
+
// different kernel
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (editorId === undefined) {
|
|
174
|
+
// all editors
|
|
175
|
+
editor.postKernelMessage(message);
|
|
176
|
+
didSend = true;
|
|
177
|
+
} else if (editor.id === editorId) {
|
|
178
|
+
// selected editors
|
|
179
|
+
editor.postKernelMessage(message);
|
|
180
|
+
didSend = true;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return didSend;
|
|
185
|
+
|
|
145
186
|
}
|
|
146
187
|
|
|
147
188
|
async $addKernel(handle: number, data: NotebookKernelDto): Promise<void> {
|
|
@@ -153,7 +194,7 @@ export class NotebookKernelsMainImpl implements NotebookKernelsMain {
|
|
|
153
194
|
async cancelNotebookCellExecution(uri: URI, handles: number[]): Promise<void> {
|
|
154
195
|
await that.proxy.$cancelCells(handle, uri.toComponents(), handles);
|
|
155
196
|
}
|
|
156
|
-
}(data, this.languageService);
|
|
197
|
+
}(handle, data, this.languageService);
|
|
157
198
|
|
|
158
199
|
const listener = this.notebookKernelService.onDidChangeSelectedKernel(e => {
|
|
159
200
|
if (e.oldKernel === kernel.id) {
|
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
import * as React from '@theia/core/shared/react';
|
|
22
22
|
import { inject, injectable, interfaces, postConstruct } from '@theia/core/shared/inversify';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { generateUuid } from '@theia/core/lib/common/uuid';
|
|
24
|
+
import {
|
|
25
|
+
NotebookRendererMessagingService, CellOutputWebview, NotebookRendererRegistry,
|
|
26
|
+
NotebookEditorWidgetService, NotebookCellOutputsSplice, NOTEBOOK_EDITOR_ID_PREFIX, NotebookKernelService, NotebookEditorWidget
|
|
27
|
+
} from '@theia/notebook/lib/browser';
|
|
25
28
|
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
|
|
26
29
|
import { WebviewWidget } from '../../webview/webview';
|
|
27
30
|
import { Message, WidgetManager } from '@theia/core/lib/browser';
|
|
@@ -31,12 +34,15 @@ import { ChangePreferredMimetypeMessage, FromWebviewMessage, OutputChangedMessag
|
|
|
31
34
|
import { CellUri } from '@theia/notebook/lib/common';
|
|
32
35
|
import { Disposable, DisposableCollection, nls, QuickPickService } from '@theia/core';
|
|
33
36
|
import { NotebookCellOutputModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-output-model';
|
|
37
|
+
import { NotebookModel } from '@theia/notebook/lib/browser/view-model/notebook-model';
|
|
34
38
|
|
|
35
39
|
const CellModel = Symbol('CellModel');
|
|
40
|
+
const Notebook = Symbol('NotebookModel');
|
|
36
41
|
|
|
37
|
-
export function createCellOutputWebviewContainer(ctx: interfaces.Container, cell: NotebookCellModel): interfaces.Container {
|
|
42
|
+
export function createCellOutputWebviewContainer(ctx: interfaces.Container, cell: NotebookCellModel, notebook: NotebookModel): interfaces.Container {
|
|
38
43
|
const child = ctx.createChild();
|
|
39
44
|
child.bind(CellModel).toConstantValue(cell);
|
|
45
|
+
child.bind(Notebook).toConstantValue(notebook);
|
|
40
46
|
child.bind(CellOutputWebviewImpl).toSelf().inSingletonScope();
|
|
41
47
|
return child;
|
|
42
48
|
}
|
|
@@ -50,6 +56,9 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
50
56
|
@inject(CellModel)
|
|
51
57
|
protected readonly cell: NotebookCellModel;
|
|
52
58
|
|
|
59
|
+
@inject(Notebook)
|
|
60
|
+
protected readonly notebook: NotebookModel;
|
|
61
|
+
|
|
53
62
|
@inject(WidgetManager)
|
|
54
63
|
protected readonly widgetManager: WidgetManager;
|
|
55
64
|
|
|
@@ -62,10 +71,15 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
62
71
|
@inject(NotebookEditorWidgetService)
|
|
63
72
|
protected readonly notebookEditorWidgetService: NotebookEditorWidgetService;
|
|
64
73
|
|
|
74
|
+
@inject(NotebookKernelService)
|
|
75
|
+
protected readonly notebookKernelService: NotebookKernelService;
|
|
76
|
+
|
|
65
77
|
@inject(QuickPickService)
|
|
66
78
|
protected readonly quickPickService: QuickPickService;
|
|
67
79
|
|
|
68
|
-
readonly id =
|
|
80
|
+
readonly id = generateUuid();
|
|
81
|
+
|
|
82
|
+
protected editor: NotebookEditorWidget | undefined;
|
|
69
83
|
|
|
70
84
|
protected readonly elementRef = React.createRef<HTMLDivElement>();
|
|
71
85
|
protected outputPresentationListeners: DisposableCollection = new DisposableCollection();
|
|
@@ -76,11 +90,30 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
76
90
|
|
|
77
91
|
@postConstruct()
|
|
78
92
|
protected async init(): Promise<void> {
|
|
93
|
+
this.editor = this.notebookEditorWidgetService.getNotebookEditor(NOTEBOOK_EDITOR_ID_PREFIX + CellUri.parse(this.cell.uri)?.notebook);
|
|
94
|
+
|
|
79
95
|
this.toDispose.push(this.cell.onDidChangeOutputs(outputChange => this.updateOutput(outputChange)));
|
|
80
96
|
this.toDispose.push(this.cell.onDidChangeOutputItems(output => {
|
|
81
|
-
this.updateOutput({start: this.cell.outputs.findIndex(o => o.outputId === output.outputId), deleteCount: 1, newOutputs: [output]});
|
|
97
|
+
this.updateOutput({ start: this.cell.outputs.findIndex(o => o.outputId === output.outputId), deleteCount: 1, newOutputs: [output] });
|
|
82
98
|
}));
|
|
83
99
|
|
|
100
|
+
if (this.editor) {
|
|
101
|
+
this.toDispose.push(this.editor.onDidPostKernelMessage(message => {
|
|
102
|
+
this.webviewWidget.sendMessage({
|
|
103
|
+
type: 'customKernelMessage',
|
|
104
|
+
message
|
|
105
|
+
});
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
this.toDispose.push(this.editor.onPostRendererMessage(messageObj => {
|
|
109
|
+
this.webviewWidget.sendMessage({
|
|
110
|
+
type: 'customRendererMessage',
|
|
111
|
+
...messageObj
|
|
112
|
+
});
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
84
117
|
this.webviewWidget = await this.widgetManager.getOrCreateWidget(WebviewWidget.FACTORY_ID, { id: this.id });
|
|
85
118
|
this.webviewWidget.setContentOptions({ allowScripts: true });
|
|
86
119
|
this.webviewWidget.setHTML(await this.createWebviewContent());
|
|
@@ -134,8 +167,8 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
134
167
|
|
|
135
168
|
private async requestOutputPresentationUpdate(output: NotebookCellOutputModel): Promise<void> {
|
|
136
169
|
const selectedMime = await this.quickPickService.show(
|
|
137
|
-
output.outputs.map(item => ({label: item.mime})),
|
|
138
|
-
{description: nls.localizeByDefault('Select mimetype to render for current output'
|
|
170
|
+
output.outputs.map(item => ({ label: item.mime })),
|
|
171
|
+
{ description: nls.localizeByDefault('Select mimetype to render for current output') });
|
|
139
172
|
if (selectedMime) {
|
|
140
173
|
this.webviewWidget.sendMessage({
|
|
141
174
|
type: 'changePreferredMimetype',
|
|
@@ -146,35 +179,52 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
146
179
|
}
|
|
147
180
|
|
|
148
181
|
private handleWebviewMessage(message: FromWebviewMessage): void {
|
|
182
|
+
if (!this.editor) {
|
|
183
|
+
throw new Error('No editor found for cell output webview');
|
|
184
|
+
}
|
|
185
|
+
|
|
149
186
|
switch (message.type) {
|
|
150
187
|
case 'initialized':
|
|
151
|
-
this.updateOutput({newOutputs: this.cell.outputs, start: 0, deleteCount: 0});
|
|
188
|
+
this.updateOutput({ newOutputs: this.cell.outputs, start: 0, deleteCount: 0 });
|
|
152
189
|
break;
|
|
153
190
|
case 'customRendererMessage':
|
|
154
|
-
this.messagingService.getScoped(
|
|
191
|
+
this.messagingService.getScoped(this.editor.id).postMessage(message.rendererId, message.message);
|
|
155
192
|
break;
|
|
156
193
|
case 'didRenderOutput':
|
|
157
194
|
this.webviewWidget.setIframeHeight(message.contentHeight + 5);
|
|
158
195
|
break;
|
|
159
196
|
case 'did-scroll-wheel':
|
|
160
|
-
this.
|
|
197
|
+
this.editor.node.children[0].children[1].scrollBy(message.deltaX, message.deltaY);
|
|
198
|
+
break;
|
|
199
|
+
case 'customKernelMessage':
|
|
200
|
+
this.editor.recieveKernelMessage(message.message);
|
|
161
201
|
break;
|
|
162
202
|
}
|
|
163
203
|
}
|
|
164
204
|
|
|
205
|
+
getPreloads(): string[] {
|
|
206
|
+
const kernel = this.notebookKernelService.getSelectedOrSuggestedKernel(this.notebook);
|
|
207
|
+
const kernelPreloads = kernel?.preloadUris.map(uri => uri.toString()) ?? [];
|
|
208
|
+
|
|
209
|
+
const staticPreloads = this.notebookRendererRegistry.staticNotebookPreloads
|
|
210
|
+
.filter(preload => preload.type === this.notebook.viewType)
|
|
211
|
+
.map(preload => preload.entrypoint);
|
|
212
|
+
return kernelPreloads.concat(staticPreloads);
|
|
213
|
+
}
|
|
214
|
+
|
|
165
215
|
private async createWebviewContent(): Promise<string> {
|
|
166
216
|
const isWorkspaceTrusted = await this.workspaceTrustService.getWorkspaceTrust();
|
|
167
217
|
const preloads = this.preloadsScriptString(isWorkspaceTrusted);
|
|
168
218
|
const content = `
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
219
|
+
<html>
|
|
220
|
+
<head>
|
|
221
|
+
<meta charset="UTF-8">
|
|
222
|
+
</head>
|
|
223
|
+
<body>
|
|
224
|
+
<script type="module">${preloads}</script>
|
|
225
|
+
</body>
|
|
226
|
+
</html>
|
|
227
|
+
`;
|
|
178
228
|
return content;
|
|
179
229
|
}
|
|
180
230
|
|
|
@@ -186,13 +236,14 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
|
|
|
186
236
|
lineLimit: 30,
|
|
187
237
|
outputScrolling: false,
|
|
188
238
|
outputWordWrap: false,
|
|
189
|
-
}
|
|
239
|
+
},
|
|
240
|
+
staticPreloadsData: this.getPreloads()
|
|
190
241
|
};
|
|
191
242
|
// TS will try compiling `import()` in webviewPreloads, so use a helper function instead
|
|
192
243
|
// of using `import(...)` directly
|
|
193
244
|
return `
|
|
194
245
|
const __import = (x) => import(x);
|
|
195
|
-
|
|
246
|
+
(${outputWebviewPreload})(JSON.parse(decodeURIComponent("${encodeURIComponent(JSON.stringify(ctx))}")))`;
|
|
196
247
|
}
|
|
197
248
|
|
|
198
249
|
dispose(): void {
|