@theia/plugin-ext 1.53.0-next.6 → 1.53.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/plugin-api-rpc-model.d.ts +1 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +13 -2
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +4 -2
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/rpc-protocol.d.ts +14 -13
- package/lib/common/rpc-protocol.d.ts.map +1 -1
- package/lib/common/rpc-protocol.js +56 -53
- package/lib/common/rpc-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +1 -0
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +13 -3
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +13 -1
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +1 -0
- package/lib/main/browser/authentication-main.d.ts.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/custom-editors/custom-editor-opener.d.ts +5 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +107 -31
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +7 -4
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +21 -7
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +4 -4
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +5 -55
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +3 -3
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +19 -15
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +1 -0
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/languages-main.d.ts +1 -0
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +3 -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 +1 -1
- 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 +1 -0
- 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 +2 -0
- package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-main.js +22 -3
- package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.js +16 -2
- package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts +1 -0
- package/lib/main/browser/notebooks/notebooks-main.d.ts.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 +18 -0
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +1 -0
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +1 -0
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/uri-main.d.ts +16 -0
- package/lib/main/browser/uri-main.d.ts.map +1 -0
- package/lib/main/browser/uri-main.js +64 -0
- package/lib/main/browser/uri-main.js.map +1 -0
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -0
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +1 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-views-main.d.ts +1 -0
- package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +2 -3
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +5 -4
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts +1 -0
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.d.ts +1 -0
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.js +6 -1
- package/lib/main/browser/webviews-main.js.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +1 -0
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +1 -0
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/clipboard-ext.d.ts +1 -0
- package/lib/plugin/clipboard-ext.d.ts.map +1 -1
- package/lib/plugin/command-registry.d.ts +1 -0
- package/lib/plugin/command-registry.d.ts.map +1 -1
- package/lib/plugin/comments.d.ts +1 -0
- package/lib/plugin/comments.d.ts.map +1 -1
- package/lib/plugin/custom-editors.d.ts +3 -4
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/custom-editors.js +5 -7
- package/lib/plugin/custom-editors.js.map +1 -1
- package/lib/plugin/debug/debug-ext.d.ts +1 -0
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
- package/lib/plugin/decorations.d.ts +1 -0
- package/lib/plugin/decorations.d.ts.map +1 -1
- package/lib/plugin/dialogs.d.ts +1 -0
- package/lib/plugin/dialogs.d.ts.map +1 -1
- package/lib/plugin/document-data.d.ts +1 -0
- package/lib/plugin/document-data.d.ts.map +1 -1
- package/lib/plugin/documents.d.ts +1 -0
- package/lib/plugin/documents.d.ts.map +1 -1
- package/lib/plugin/env.d.ts +3 -0
- package/lib/plugin/env.d.ts.map +1 -1
- package/lib/plugin/env.js +4 -1
- package/lib/plugin/env.js.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts +1 -0
- package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +1 -0
- package/lib/plugin/file-system-ext-impl.d.ts.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/label-service.d.ts +1 -0
- package/lib/plugin/label-service.d.ts.map +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts +1 -0
- package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.d.ts +1 -0
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/color.d.ts +1 -0
- package/lib/plugin/languages/color.d.ts.map +1 -1
- package/lib/plugin/languages/completion.d.ts +1 -0
- package/lib/plugin/languages/completion.d.ts.map +1 -1
- package/lib/plugin/languages/declaration.d.ts +1 -0
- package/lib/plugin/languages/declaration.d.ts.map +1 -1
- package/lib/plugin/languages/definition.d.ts +1 -0
- package/lib/plugin/languages/definition.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +1 -0
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/document-drop-edit.d.ts +1 -0
- package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
- package/lib/plugin/languages/document-formatting.d.ts +1 -0
- package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts +1 -0
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts +1 -0
- package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
- package/lib/plugin/languages/folding.d.ts +1 -0
- package/lib/plugin/languages/folding.d.ts.map +1 -1
- package/lib/plugin/languages/hover.d.ts +1 -0
- package/lib/plugin/languages/hover.d.ts.map +1 -1
- package/lib/plugin/languages/implementation.d.ts +1 -0
- package/lib/plugin/languages/implementation.d.ts.map +1 -1
- package/lib/plugin/languages/inlay-hints.d.ts +1 -0
- package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
- package/lib/plugin/languages/inline-completion.d.ts +1 -0
- package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
- package/lib/plugin/languages/inline-values.d.ts +1 -0
- package/lib/plugin/languages/inline-values.d.ts.map +1 -1
- package/lib/plugin/languages/lens.d.ts +1 -0
- package/lib/plugin/languages/lens.d.ts.map +1 -1
- package/lib/plugin/languages/link-provider.d.ts +1 -0
- package/lib/plugin/languages/link-provider.d.ts.map +1 -1
- package/lib/plugin/languages/linked-editing-range.d.ts +1 -0
- package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
- package/lib/plugin/languages/on-type-formatting.d.ts +1 -0
- package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/outline.d.ts +1 -0
- package/lib/plugin/languages/outline.d.ts.map +1 -1
- package/lib/plugin/languages/range-formatting.d.ts +1 -0
- package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/reference.d.ts +1 -0
- package/lib/plugin/languages/reference.d.ts.map +1 -1
- package/lib/plugin/languages/rename.d.ts +1 -0
- package/lib/plugin/languages/rename.d.ts.map +1 -1
- package/lib/plugin/languages/selection-range.d.ts +1 -0
- package/lib/plugin/languages/selection-range.d.ts.map +1 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts +1 -0
- package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
- package/lib/plugin/languages/signature.d.ts +1 -0
- package/lib/plugin/languages/signature.d.ts.map +1 -1
- package/lib/plugin/languages/type-definition.d.ts +1 -0
- package/lib/plugin/languages/type-definition.d.ts.map +1 -1
- package/lib/plugin/languages/type-hierarchy.d.ts +1 -0
- package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/util.d.ts +1 -0
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/workspace-symbol.d.ts +1 -0
- package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
- package/lib/plugin/languages-utils.d.ts +1 -0
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages.d.ts +1 -0
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/markdown-string.d.ts +1 -0
- package/lib/plugin/markdown-string.d.ts.map +1 -1
- package/lib/plugin/message-registry.d.ts +1 -0
- package/lib/plugin/message-registry.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +1 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-document.d.ts +1 -0
- package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-documents.d.ts +1 -0
- package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editor.d.ts +1 -0
- package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editors.d.ts +1 -0
- package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts +1 -0
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts +1 -0
- package/lib/plugin/notebook/notebook-renderers.d.ts.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/notification.d.ts +1 -0
- package/lib/plugin/notification.d.ts.map +1 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts +1 -0
- package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts +1 -0
- package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
- package/lib/plugin/output-channel-registry.d.ts +1 -0
- package/lib/plugin/output-channel-registry.d.ts.map +1 -1
- package/lib/plugin/plugin-context.d.ts +1 -0
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +14 -6
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts +1 -0
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-manager.js +2 -1
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/plugin-storage.d.ts +1 -0
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/preference-registry.d.ts +1 -0
- package/lib/plugin/preference-registry.d.ts.map +1 -1
- package/lib/plugin/quick-open.d.ts +1 -0
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/scm.d.ts +1 -0
- package/lib/plugin/scm.d.ts.map +1 -1
- package/lib/plugin/secrets-ext.d.ts +1 -0
- package/lib/plugin/secrets-ext.d.ts.map +1 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts +1 -0
- package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts +1 -0
- package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
- package/lib/plugin/tabs.d.ts +1 -0
- package/lib/plugin/tabs.d.ts.map +1 -1
- package/lib/plugin/tasks/task-provider.d.ts +1 -0
- package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +1 -0
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +2 -0
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +1 -0
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/test-item.d.ts +1 -0
- package/lib/plugin/test-item.d.ts.map +1 -1
- package/lib/plugin/tests.d.ts +1 -0
- package/lib/plugin/tests.d.ts.map +1 -1
- package/lib/plugin/text-editor.d.ts +1 -0
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editors.d.ts +1 -0
- package/lib/plugin/text-editors.d.ts.map +1 -1
- package/lib/plugin/timeline.d.ts +1 -0
- package/lib/plugin/timeline.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +1 -0
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/type-converters.d.ts +1 -0
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/types-impl.d.ts +6 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +9 -1
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/uri-ext.d.ts +38 -0
- package/lib/plugin/uri-ext.d.ts.map +1 -0
- package/lib/plugin/uri-ext.js +50 -0
- package/lib/plugin/uri-ext.js.map +1 -0
- package/lib/plugin/webview-views.d.ts +1 -0
- package/lib/plugin/webview-views.d.ts.map +1 -1
- package/lib/plugin/webviews.d.ts +1 -0
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/webviews.js +1 -1
- package/lib/plugin/webviews.js.map +1 -1
- package/lib/plugin/window-state.d.ts +1 -0
- package/lib/plugin/window-state.d.ts.map +1 -1
- package/lib/plugin/workspace.d.ts +1 -0
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/common/plugin-api-rpc.ts +17 -4
- package/src/common/rpc-protocol.ts +62 -66
- package/src/hosted/browser/hosted-plugin.ts +16 -5
- package/src/hosted/node/scanners/scanner-theia.ts +12 -1
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +110 -25
- package/src/main/browser/custom-editors/custom-editor-widget.ts +20 -11
- package/src/main/browser/custom-editors/custom-editors-main.ts +11 -70
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +15 -13
- package/src/main/browser/main-context.ts +4 -0
- package/src/main/browser/menus/menus-contribution-handler.ts +2 -1
- package/src/main/browser/menus/plugin-menu-command-adapter.ts +1 -0
- package/src/main/browser/menus/vscode-theia-menu-mappings.ts +3 -1
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +1 -1
- package/src/main/browser/notebooks/notebook-documents-main.ts +24 -4
- package/src/main/browser/notebooks/notebook-editors-main.ts +15 -2
- package/src/main/browser/plugin-ext-frontend-module.ts +23 -4
- package/src/main/browser/uri-main.ts +72 -0
- package/src/main/browser/webview/pre/service-worker.js +2 -1
- package/src/main/browser/webview/webview.ts +5 -6
- package/src/main/browser/webviews-main.ts +6 -1
- package/src/plugin/custom-editors.ts +8 -10
- package/src/plugin/env.ts +6 -1
- package/src/plugin/known-commands.ts +1 -0
- package/src/plugin/plugin-context.ts +16 -8
- package/src/plugin/plugin-manager.ts +2 -1
- package/src/plugin/terminal-ext.ts +2 -0
- package/src/plugin/types-impl.ts +10 -0
- package/src/plugin/uri-ext.ts +60 -0
- package/src/plugin/webviews.ts +1 -1
- package/lib/common/proxy-handler.d.ts +0 -73
- package/lib/common/proxy-handler.d.ts.map +0 -1
- package/lib/common/proxy-handler.js +0 -106
- package/lib/common/proxy-handler.js.map +0 -1
- package/src/common/proxy-handler.ts +0 -143
|
@@ -21,10 +21,10 @@ import '../../../src/main/browser/style/comments.css';
|
|
|
21
21
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
22
22
|
import {
|
|
23
23
|
FrontendApplicationContribution, WidgetFactory, bindViewContribution,
|
|
24
|
-
ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution,
|
|
25
|
-
UndoRedoHandler
|
|
24
|
+
ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution, LabelProvider,
|
|
25
|
+
UndoRedoHandler, DiffUris, Navigatable, SplitWidget
|
|
26
26
|
} from '@theia/core/lib/browser';
|
|
27
|
-
import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider } from '@theia/core/lib/common';
|
|
27
|
+
import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider, URI, generateUuid } from '@theia/core/lib/common';
|
|
28
28
|
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
|
|
29
29
|
import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
|
|
30
30
|
import { HostedPluginWatcher } from '../../hosted/browser/hosted-plugin-watcher';
|
|
@@ -200,6 +200,25 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
200
200
|
bind(CustomEditorUndoRedoHandler).toSelf().inSingletonScope();
|
|
201
201
|
bind(UndoRedoHandler).toService(CustomEditorUndoRedoHandler);
|
|
202
202
|
|
|
203
|
+
bind(WidgetFactory).toDynamicValue(ctx => ({
|
|
204
|
+
id: CustomEditorWidget.SIDE_BY_SIDE_FACTORY_ID,
|
|
205
|
+
createWidget: (arg: { uri: string, viewType: string }) => {
|
|
206
|
+
const uri = new URI(arg.uri);
|
|
207
|
+
const [leftUri, rightUri] = DiffUris.decode(uri);
|
|
208
|
+
const navigatable: Navigatable = {
|
|
209
|
+
getResourceUri: () => rightUri,
|
|
210
|
+
createMoveToUri: resourceUri => DiffUris.encode(leftUri, rightUri.withPath(resourceUri.path))
|
|
211
|
+
};
|
|
212
|
+
const widget = new SplitWidget({ navigatable });
|
|
213
|
+
widget.id = arg.viewType + '.side-by-side:' + generateUuid();
|
|
214
|
+
const labelProvider = ctx.container.get(LabelProvider);
|
|
215
|
+
widget.title.label = labelProvider.getName(uri);
|
|
216
|
+
widget.title.iconClass = labelProvider.getIcon(uri);
|
|
217
|
+
widget.title.closable = true;
|
|
218
|
+
return widget;
|
|
219
|
+
}
|
|
220
|
+
})).inSingletonScope();
|
|
221
|
+
|
|
203
222
|
bind(PluginViewWidget).toSelf();
|
|
204
223
|
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
205
224
|
id: PLUGIN_VIEW_FACTORY_ID,
|
|
@@ -267,6 +286,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
267
286
|
bind(CellOutputWebviewFactory).toFactory(ctx => async (cell: NotebookCellModel, notebook: NotebookModel) =>
|
|
268
287
|
createCellOutputWebviewContainer(ctx.container, cell, notebook).getAsync(CellOutputWebviewImpl)
|
|
269
288
|
);
|
|
270
|
-
|
|
271
289
|
bindContributionProvider(bind, ArgumentProcessorContribution);
|
|
290
|
+
|
|
272
291
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 STMicroelectronics.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Disposable, URI } from '@theia/core';
|
|
18
|
+
import { MAIN_RPC_CONTEXT, UriExt, UriMain } from '../../common';
|
|
19
|
+
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
20
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
21
|
+
import { OpenHandler, OpenerOptions, OpenerService } from '@theia/core/lib/browser';
|
|
22
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
23
|
+
import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
|
|
24
|
+
|
|
25
|
+
export class UriMainImpl implements UriMain, Disposable {
|
|
26
|
+
private readonly proxy: UriExt;
|
|
27
|
+
private handlers = new Set<string>();
|
|
28
|
+
private readonly openerService: OpenerService;
|
|
29
|
+
private readonly pluginSupport: HostedPluginSupport;
|
|
30
|
+
private readonly openHandler: OpenHandler;
|
|
31
|
+
|
|
32
|
+
constructor(rpc: RPCProtocol, container: interfaces.Container) {
|
|
33
|
+
this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.URI_EXT);
|
|
34
|
+
this.openerService = container.get(OpenerService);
|
|
35
|
+
this.pluginSupport = container.get(HostedPluginSupport);
|
|
36
|
+
|
|
37
|
+
this.openHandler = {
|
|
38
|
+
id: 'theia-plugin-open-handler',
|
|
39
|
+
canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise<number> => {
|
|
40
|
+
if (uri.scheme !== FrontendApplicationConfigProvider.get().electron.uriScheme) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
await this.pluginSupport.activateByUri(uri.scheme, uri.authority);
|
|
44
|
+
if (this.handlers.has(uri.authority)) {
|
|
45
|
+
return 500;
|
|
46
|
+
}
|
|
47
|
+
return 0;
|
|
48
|
+
},
|
|
49
|
+
open: async (uri: URI, options?: OpenerOptions | undefined): Promise<undefined> => {
|
|
50
|
+
if (!this.handlers.has(uri.authority)) {
|
|
51
|
+
throw new Error(`No plugin to handle this uri: : '${uri}'`);
|
|
52
|
+
}
|
|
53
|
+
this.proxy.$handleExternalUri(uri.toComponents());
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
this.openerService.addHandler?.(this.openHandler);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
dispose(): void {
|
|
61
|
+
this.openerService.removeHandler?.(this.openHandler);
|
|
62
|
+
this.handlers.clear();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async $registerUriHandler(pluginId: string, extensionDisplayName: string): Promise<void> {
|
|
66
|
+
this.handlers.add(pluginId);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async $unregisterUriHandler(pluginId: string): Promise<void> {
|
|
70
|
+
this.handlers.delete(pluginId);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -226,7 +226,8 @@ async function processResourceRequest(event, requestUrl, resourceRoot) {
|
|
|
226
226
|
|
|
227
227
|
parentClient.postMessage({
|
|
228
228
|
channel: 'load-resource',
|
|
229
|
-
path: resourcePath
|
|
229
|
+
path: resourcePath,
|
|
230
|
+
query: requestUrl.search.replace(/^\?/, '')
|
|
230
231
|
});
|
|
231
232
|
|
|
232
233
|
return resourceRequestStore.create(webviewId, resourcePath)
|
|
@@ -48,7 +48,6 @@ import { isFirefox } from '@theia/core/lib/browser/browser';
|
|
|
48
48
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
49
49
|
import { FileOperationError, FileOperationResult } from '@theia/filesystem/lib/common/files';
|
|
50
50
|
import { BinaryBufferReadableStream } from '@theia/core/lib/common/buffer';
|
|
51
|
-
import { ViewColumn } from '../../../plugin/types-impl';
|
|
52
51
|
import { ExtractableWidget } from '@theia/core/lib/browser/widgets/extractable-widget';
|
|
53
52
|
import { BadgeWidget } from '@theia/core/lib/browser/view-container';
|
|
54
53
|
import { MenuPath } from '@theia/core';
|
|
@@ -185,7 +184,6 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
|
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
viewType: string;
|
|
188
|
-
viewColumn: ViewColumn;
|
|
189
187
|
options: WebviewPanelOptions = {};
|
|
190
188
|
|
|
191
189
|
protected ready = new Deferred<void>();
|
|
@@ -352,7 +350,7 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
|
|
|
352
350
|
/* no-op: webview loses focus only if another element gains focus in the main window */
|
|
353
351
|
}));
|
|
354
352
|
this.toHide.push(this.on(WebviewMessageChannels.doReload, () => this.reload()));
|
|
355
|
-
this.toHide.push(this.on(WebviewMessageChannels.loadResource, (entry: any) => this.loadResource(entry.path)));
|
|
353
|
+
this.toHide.push(this.on(WebviewMessageChannels.loadResource, (entry: any) => this.loadResource(entry.path, entry.query)));
|
|
356
354
|
this.toHide.push(this.on(WebviewMessageChannels.loadLocalhost, (entry: any) =>
|
|
357
355
|
this.loadLocalhost(entry.origin)
|
|
358
356
|
));
|
|
@@ -544,10 +542,11 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
|
|
|
544
542
|
return undefined;
|
|
545
543
|
}
|
|
546
544
|
|
|
547
|
-
protected async loadResource(requestPath: string): Promise<void> {
|
|
548
|
-
const normalizedUri = this.normalizeRequestUri(requestPath);
|
|
545
|
+
protected async loadResource(requestPath: string, requestQuery: string = ''): Promise<void> {
|
|
546
|
+
const normalizedUri = this.normalizeRequestUri(requestPath).withQuery(decodeURIComponent(requestQuery));
|
|
549
547
|
// browser cache does not support file scheme, normalize to current endpoint scheme and host
|
|
550
|
-
|
|
548
|
+
// use requestPath rather than normalizedUri.path to preserve the scheme of the requested resource as a path segment
|
|
549
|
+
const cacheUrl = new Endpoint({ path: requestPath }).getRestUrl().withQuery(decodeURIComponent(requestQuery)).toString();
|
|
551
550
|
|
|
552
551
|
try {
|
|
553
552
|
if (this.contentOptions.localResourceRoots) {
|
|
@@ -191,7 +191,12 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
|
|
|
191
191
|
|
|
192
192
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
193
193
|
async $postMessage(handle: string, value: any): Promise<boolean> {
|
|
194
|
-
|
|
194
|
+
// Due to async nature of $postMessage, the webview may have been disposed in the meantime.
|
|
195
|
+
// Therefore, don't throw an error if the webview is not found, but return false in this case.
|
|
196
|
+
const webview = await this.tryGetWebview(handle);
|
|
197
|
+
if (!webview) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
195
200
|
webview.sendMessage(value);
|
|
196
201
|
return true;
|
|
197
202
|
}
|
|
@@ -25,11 +25,11 @@ import { RPCProtocol } from '../common/rpc-protocol';
|
|
|
25
25
|
import { Disposable, URI } from './types-impl';
|
|
26
26
|
import { UriComponents } from '../common/uri-components';
|
|
27
27
|
import { DocumentsExtImpl } from './documents';
|
|
28
|
-
import {
|
|
28
|
+
import { WebviewsExtImpl } from './webviews';
|
|
29
29
|
import { CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
|
|
30
30
|
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
31
|
-
import { WorkspaceExtImpl } from './workspace';
|
|
32
31
|
import { Cache } from '../common/cache';
|
|
32
|
+
import * as Converters from './type-converters';
|
|
33
33
|
|
|
34
34
|
export class CustomEditorsExtImpl implements CustomEditorsExt {
|
|
35
35
|
private readonly proxy: CustomEditorsMain;
|
|
@@ -38,8 +38,7 @@ export class CustomEditorsExtImpl implements CustomEditorsExt {
|
|
|
38
38
|
|
|
39
39
|
constructor(rpc: RPCProtocol,
|
|
40
40
|
private readonly documentExt: DocumentsExtImpl,
|
|
41
|
-
private readonly webviewExt: WebviewsExtImpl
|
|
42
|
-
private readonly workspace: WorkspaceExtImpl) {
|
|
41
|
+
private readonly webviewExt: WebviewsExtImpl) {
|
|
43
42
|
this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.CUSTOM_EDITORS_MAIN);
|
|
44
43
|
}
|
|
45
44
|
|
|
@@ -116,22 +115,21 @@ export class CustomEditorsExtImpl implements CustomEditorsExt {
|
|
|
116
115
|
document.dispose();
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
async $resolveWebviewEditor
|
|
118
|
+
async $resolveWebviewEditor(
|
|
120
119
|
resource: UriComponents,
|
|
121
120
|
handler: string,
|
|
122
121
|
viewType: string,
|
|
123
122
|
title: string,
|
|
124
|
-
|
|
125
|
-
options: theia.WebviewPanelOptions
|
|
123
|
+
position: number,
|
|
124
|
+
options: theia.WebviewPanelOptions,
|
|
126
125
|
cancellation: CancellationToken
|
|
127
126
|
): Promise<void> {
|
|
128
127
|
const entry = this.editorProviders.get(viewType);
|
|
129
128
|
if (!entry) {
|
|
130
129
|
throw new Error(`No provider found for '${viewType}'`);
|
|
131
130
|
}
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
await this.proxy.$createCustomEditorPanel(handler, title, widgetOpenerOptions, webviewOptions);
|
|
131
|
+
const viewColumn = Converters.toViewColumn(position);
|
|
132
|
+
const panel = this.webviewExt.createWebviewPanel(viewType, title, { viewColumn }, options, entry.plugin, handler, false);
|
|
135
133
|
|
|
136
134
|
const revivedResource = URI.revive(resource);
|
|
137
135
|
|
package/src/plugin/env.ts
CHANGED
|
@@ -35,6 +35,7 @@ export abstract class EnvExtImpl {
|
|
|
35
35
|
private envSessionId: string;
|
|
36
36
|
private host: string;
|
|
37
37
|
private applicationRoot: string;
|
|
38
|
+
private appUriScheme: string;
|
|
38
39
|
private _remoteName: string | undefined;
|
|
39
40
|
|
|
40
41
|
constructor() {
|
|
@@ -89,6 +90,10 @@ export abstract class EnvExtImpl {
|
|
|
89
90
|
this.applicationRoot = appRoot;
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
setAppUriScheme(uriScheme: string): void {
|
|
94
|
+
this.appUriScheme = uriScheme;
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
getClientOperatingSystem(): Promise<theia.OperatingSystem> {
|
|
93
98
|
return this.proxy.$getClientOperatingSystem();
|
|
94
99
|
}
|
|
@@ -121,7 +126,7 @@ export abstract class EnvExtImpl {
|
|
|
121
126
|
return this.envSessionId;
|
|
122
127
|
}
|
|
123
128
|
get uriScheme(): string {
|
|
124
|
-
return
|
|
129
|
+
return this.appUriScheme;
|
|
125
130
|
}
|
|
126
131
|
get uiKind(): theia.UIKind {
|
|
127
132
|
return this.ui;
|
|
@@ -297,6 +297,7 @@ export namespace KnownCommands {
|
|
|
297
297
|
mappings['vscode.executeFormatDocumentProvider'] = ['vscode.executeFormatDocumentProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
298
298
|
mappings['vscode.executeFormatRangeProvider'] = ['vscode.executeFormatRangeProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
299
299
|
mappings['vscode.executeFormatOnTypeProvider'] = ['vscode.executeFormatOnTypeProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
300
|
+
mappings['vscode.executeCodeActionProvider'] = ['vscode.executeCodeActionProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
300
301
|
mappings['vscode.prepareCallHierarchy'] = ['vscode.prepareCallHierarchy', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
301
302
|
mappings['vscode.provideIncomingCalls'] = ['vscode.provideIncomingCalls', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
302
303
|
mappings['vscode.provideOutgoingCalls'] = ['vscode.provideOutgoingCalls', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
|
|
@@ -228,7 +228,8 @@ import {
|
|
|
228
228
|
LanguageModelError,
|
|
229
229
|
PortAutoForwardAction,
|
|
230
230
|
PortAttributes,
|
|
231
|
-
DebugVisualization
|
|
231
|
+
DebugVisualization,
|
|
232
|
+
TerminalShellExecutionCommandLineConfidence
|
|
232
233
|
} from './types-impl';
|
|
233
234
|
import { AuthenticationExtImpl } from './authentication-ext';
|
|
234
235
|
import { SymbolKind } from '../common/plugin-api-rpc-model';
|
|
@@ -275,6 +276,7 @@ import { NotebookKernelsExtImpl } from './notebook/notebook-kernels';
|
|
|
275
276
|
import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
|
|
276
277
|
import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
|
|
277
278
|
import { TestingExtImpl } from './tests';
|
|
279
|
+
import { UriExtImpl } from './uri-ext';
|
|
278
280
|
|
|
279
281
|
export function createAPIFactory(
|
|
280
282
|
rpc: RPCProtocol,
|
|
@@ -319,10 +321,11 @@ export function createAPIFactory(
|
|
|
319
321
|
const themingExt = rpc.set(MAIN_RPC_CONTEXT.THEMING_EXT, new ThemingExtImpl(rpc));
|
|
320
322
|
const commentsExt = rpc.set(MAIN_RPC_CONTEXT.COMMENTS_EXT, new CommentsExtImpl(rpc, commandRegistry, documents));
|
|
321
323
|
const tabsExt = rpc.set(MAIN_RPC_CONTEXT.TABS_EXT, new TabsExtImpl(rpc));
|
|
322
|
-
const customEditorExt = rpc.set(MAIN_RPC_CONTEXT.CUSTOM_EDITORS_EXT, new CustomEditorsExtImpl(rpc, documents, webviewExt
|
|
324
|
+
const customEditorExt = rpc.set(MAIN_RPC_CONTEXT.CUSTOM_EDITORS_EXT, new CustomEditorsExtImpl(rpc, documents, webviewExt));
|
|
323
325
|
const webviewViewsExt = rpc.set(MAIN_RPC_CONTEXT.WEBVIEW_VIEWS_EXT, new WebviewViewsExtImpl(rpc, webviewExt));
|
|
324
326
|
const telemetryExt = rpc.set(MAIN_RPC_CONTEXT.TELEMETRY_EXT, new TelemetryExtImpl());
|
|
325
327
|
const testingExt = rpc.set(MAIN_RPC_CONTEXT.TESTING_EXT, new TestingExtImpl(rpc, commandRegistry));
|
|
328
|
+
const uriExt = rpc.set(MAIN_RPC_CONTEXT.URI_EXT, new UriExtImpl(rpc));
|
|
326
329
|
rpc.set(MAIN_RPC_CONTEXT.DEBUG_EXT, debugExt);
|
|
327
330
|
|
|
328
331
|
return function (plugin: InternalPlugin): typeof theia {
|
|
@@ -595,8 +598,7 @@ export function createAPIFactory(
|
|
|
595
598
|
return decorationsExt.registerFileDecorationProvider(provider, pluginToPluginInfo(plugin));
|
|
596
599
|
},
|
|
597
600
|
registerUriHandler(handler: theia.UriHandler): theia.Disposable {
|
|
598
|
-
|
|
599
|
-
return new Disposable(() => { });
|
|
601
|
+
return uriExt.registerUriHandler(handler, pluginToPluginInfo(plugin));
|
|
600
602
|
},
|
|
601
603
|
createInputBox(): theia.InputBox {
|
|
602
604
|
return quickOpenExt.createInputBox(plugin);
|
|
@@ -636,6 +638,12 @@ export function createAPIFactory(
|
|
|
636
638
|
|
|
637
639
|
/** @stubbed ShareProvider */
|
|
638
640
|
registerShareProvider: () => Disposable.NULL,
|
|
641
|
+
/** @stubbed Terminal Shell Ingration */
|
|
642
|
+
onDidChangeTerminalShellIntegration: Event.None,
|
|
643
|
+
/** @stubbed Terminal Shell Ingration */
|
|
644
|
+
onDidEndTerminalShellExecution: Event.None,
|
|
645
|
+
/** @stubbed Terminal Shell Ingration */
|
|
646
|
+
onDidStartTerminalShellExecution: Event.None
|
|
639
647
|
};
|
|
640
648
|
|
|
641
649
|
const workspace: typeof theia.workspace = {
|
|
@@ -740,9 +748,8 @@ export function createAPIFactory(
|
|
|
740
748
|
} else {
|
|
741
749
|
throw new Error('Invalid arguments');
|
|
742
750
|
}
|
|
743
|
-
|
|
744
|
-
return
|
|
745
|
-
|
|
751
|
+
// Notebook extension will create a document in openNotebookDocument() or create openNotebookDocument()
|
|
752
|
+
return notebooksExt.getNotebookDocument(uri).apiNotebook;
|
|
746
753
|
},
|
|
747
754
|
createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
|
|
748
755
|
extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
|
|
@@ -1495,7 +1502,8 @@ export function createAPIFactory(
|
|
|
1495
1502
|
LanguageModelError,
|
|
1496
1503
|
PortAutoForwardAction,
|
|
1497
1504
|
PortAttributes,
|
|
1498
|
-
DebugVisualization
|
|
1505
|
+
DebugVisualization,
|
|
1506
|
+
TerminalShellExecutionCommandLineConfidence
|
|
1499
1507
|
};
|
|
1500
1508
|
};
|
|
1501
1509
|
}
|
|
@@ -252,7 +252,7 @@ export abstract class AbstractPluginManagerExtImpl<P extends Record<string, any>
|
|
|
252
252
|
}
|
|
253
253
|
for (let activationEvent of activationEvents) {
|
|
254
254
|
if (activationEvent === 'onUri') {
|
|
255
|
-
activationEvent = `onUri
|
|
255
|
+
activationEvent = `onUri:${this.envExt.uriScheme}://${plugin.model.id}`;
|
|
256
256
|
}
|
|
257
257
|
this.setActivation(activationEvent, activation);
|
|
258
258
|
}
|
|
@@ -481,6 +481,7 @@ export class PluginManagerExtImpl extends AbstractPluginManagerExtImpl<PluginMan
|
|
|
481
481
|
this.envExt.setApplicationName(params.env.appName);
|
|
482
482
|
this.envExt.setAppHost(params.env.appHost);
|
|
483
483
|
this.envExt.setAppRoot(params.env.appRoot);
|
|
484
|
+
this.envExt.setAppUriScheme(params.env.appUriScheme);
|
|
484
485
|
|
|
485
486
|
this.preferencesManager.init(params.preferences);
|
|
486
487
|
|
|
@@ -478,6 +478,8 @@ export class TerminalExtImpl implements theia.Terminal {
|
|
|
478
478
|
this.creationOptions = this.options;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
shellIntegration: theia.TerminalShellIntegration | undefined = undefined;
|
|
482
|
+
|
|
481
483
|
sendText(text: string, shouldExecute: boolean = true): void {
|
|
482
484
|
this.id.promise.then(id => this.proxy.$sendText(id, text, shouldExecute));
|
|
483
485
|
}
|
package/src/plugin/types-impl.ts
CHANGED
|
@@ -3999,3 +3999,13 @@ export class DebugVisualization {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
|
|
4001
4001
|
// #endregion
|
|
4002
|
+
|
|
4003
|
+
// #region Terminal Shell Integration
|
|
4004
|
+
|
|
4005
|
+
export enum TerminalShellExecutionCommandLineConfidence {
|
|
4006
|
+
Low = 0,
|
|
4007
|
+
Medium = 1,
|
|
4008
|
+
High = 2
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
// #endregion
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 STMicroelectronics.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as theia from '@theia/plugin';
|
|
18
|
+
import {
|
|
19
|
+
UriExt,
|
|
20
|
+
PLUGIN_RPC_CONTEXT, PluginInfo, UriMain
|
|
21
|
+
} from '../common/plugin-api-rpc';
|
|
22
|
+
import { RPCProtocol } from '../common/rpc-protocol';
|
|
23
|
+
import { Disposable, URI } from './types-impl';
|
|
24
|
+
import { UriComponents } from '../common/uri-components';
|
|
25
|
+
|
|
26
|
+
export class UriExtImpl implements UriExt {
|
|
27
|
+
|
|
28
|
+
private handlers = new Map<string, theia.UriHandler>();
|
|
29
|
+
|
|
30
|
+
private readonly proxy: UriMain;
|
|
31
|
+
|
|
32
|
+
constructor(readonly rpc: RPCProtocol) {
|
|
33
|
+
this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.URI_MAIN);
|
|
34
|
+
console.log(this.proxy);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
registerUriHandler(handler: theia.UriHandler, plugin: PluginInfo): theia.Disposable {
|
|
38
|
+
const pluginId = plugin.id;
|
|
39
|
+
if (this.handlers.has(pluginId)) {
|
|
40
|
+
throw new Error(`URI handler already registered for plugin ${pluginId}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.handlers.set(pluginId, handler);
|
|
44
|
+
this.proxy.$registerUriHandler(pluginId, plugin.displayName || plugin.name);
|
|
45
|
+
|
|
46
|
+
return new Disposable(() => {
|
|
47
|
+
this.proxy.$unregisterUriHandler(pluginId);
|
|
48
|
+
this.handlers.delete(pluginId);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
$handleExternalUri(uri: UriComponents): Promise<void> {
|
|
53
|
+
const handler = this.handlers.get(uri.authority);
|
|
54
|
+
if (!handler) {
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
57
|
+
handler.handleUri(URI.revive(uri));
|
|
58
|
+
return Promise.resolve();
|
|
59
|
+
}
|
|
60
|
+
}
|
package/src/plugin/webviews.ts
CHANGED
|
@@ -255,7 +255,7 @@ export class WebviewImpl implements theia.Webview {
|
|
|
255
255
|
.replace('{{authority}}', resource.authority)
|
|
256
256
|
.replace('{{path}}', resource.path.replace(/^\//, ''))
|
|
257
257
|
.replace('{{uuid}}', this.origin ?? this.viewId);
|
|
258
|
-
return URI.parse(uri);
|
|
258
|
+
return URI.parse(uri).with({ query: resource.query });
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
get cspSource(): string {
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (C) 2022 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { Channel } from '@theia/core/';
|
|
17
|
-
import { RpcMessageDecoder, RpcMessageEncoder } from '@theia/core/lib/common/message-rpc/rpc-message-encoder';
|
|
18
|
-
export interface RpcHandlerOptions {
|
|
19
|
-
id: string;
|
|
20
|
-
encoder: RpcMessageEncoder;
|
|
21
|
-
decoder: RpcMessageDecoder;
|
|
22
|
-
}
|
|
23
|
-
export interface ProxyHandlerOptions extends RpcHandlerOptions {
|
|
24
|
-
channelProvider: () => Promise<Channel>;
|
|
25
|
-
proxySynchronizer: ProxySynchronizer;
|
|
26
|
-
}
|
|
27
|
-
export interface InvocationHandlerOptions extends RpcHandlerOptions {
|
|
28
|
-
target: any;
|
|
29
|
-
}
|
|
30
|
-
export interface ProxySynchronizer {
|
|
31
|
-
startProxyInitialization(id: string, init: Promise<void>): void;
|
|
32
|
-
pendingProxyInitializations(): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* A proxy handler that will send any method invocation on the proxied object
|
|
36
|
-
* as a rcp protocol message over a channel.
|
|
37
|
-
*/
|
|
38
|
-
export declare class ClientProxyHandler<T extends object> implements ProxyHandler<T> {
|
|
39
|
-
private rpcDeferred;
|
|
40
|
-
private isRpcInitialized;
|
|
41
|
-
readonly id: string;
|
|
42
|
-
private readonly channelProvider;
|
|
43
|
-
private readonly proxySynchronizer;
|
|
44
|
-
private readonly encoder;
|
|
45
|
-
private readonly decoder;
|
|
46
|
-
constructor(options: ProxyHandlerOptions);
|
|
47
|
-
private initializeRpc;
|
|
48
|
-
get(target: any, name: string, receiver: any): any;
|
|
49
|
-
private sendWhenNoInit;
|
|
50
|
-
/**
|
|
51
|
-
* Return whether the given property represents a notification. If true,
|
|
52
|
-
* the promise returned from the invocation will resolve immediately to `undefined`
|
|
53
|
-
*
|
|
54
|
-
* A property leads to a notification rather than a method call if its name
|
|
55
|
-
* begins with `notify` or `on`.
|
|
56
|
-
*
|
|
57
|
-
* @param p - The property being called on the proxy.
|
|
58
|
-
* @return Whether `p` represents a notification.
|
|
59
|
-
*/
|
|
60
|
-
protected isNotification(p: PropertyKey): boolean;
|
|
61
|
-
}
|
|
62
|
-
export declare class RpcInvocationHandler {
|
|
63
|
-
readonly id: string;
|
|
64
|
-
readonly target: any;
|
|
65
|
-
private rpcDeferred;
|
|
66
|
-
private readonly encoder;
|
|
67
|
-
private readonly decoder;
|
|
68
|
-
constructor(options: InvocationHandlerOptions);
|
|
69
|
-
listen(channel: Channel): void;
|
|
70
|
-
protected handleRequest(method: string, args: any[]): Promise<any>;
|
|
71
|
-
protected onNotification(method: string, args: any[]): void;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=proxy-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-handler.d.ts","sourceRoot":"","sources":["../../src/common/proxy-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAG9G,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAA;CAC7B;AACD,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,iBAAiB,EAAE,iBAAiB,CAAC;CACxC;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IAC/D,MAAM,EAAE,GAAG,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAC9B,wBAAwB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC/D,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/C;AAED;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,WAAW,CAAyC;IAC5D,OAAO,CAAC,gBAAgB,CAAS;IAEjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IACzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,OAAO,EAAE,mBAAmB;IAIxC,OAAO,CAAC,aAAa;IAYrB,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG;IAqBlD,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;CAOpD;AAED,qBAAa,oBAAoB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAErB,OAAO,CAAC,WAAW,CAAyC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,OAAO,EAAE,wBAAwB;IAI7C,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAO9B,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlE,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAK9D"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RpcInvocationHandler = exports.ClientProxyHandler = void 0;
|
|
4
|
-
/********************************************************************************
|
|
5
|
-
* Copyright (C) 2022 STMicroelectronics and others.
|
|
6
|
-
*
|
|
7
|
-
* This program and the accompanying materials are made available under the
|
|
8
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
-
*
|
|
11
|
-
* This Source Code may also be made available under the following Secondary
|
|
12
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
-
* with the GNU Classpath Exception which is available at
|
|
15
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
-
*
|
|
17
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
18
|
-
********************************************************************************/
|
|
19
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
|
-
const core_1 = require("@theia/core/");
|
|
21
|
-
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
22
|
-
/**
|
|
23
|
-
* A proxy handler that will send any method invocation on the proxied object
|
|
24
|
-
* as a rcp protocol message over a channel.
|
|
25
|
-
*/
|
|
26
|
-
class ClientProxyHandler {
|
|
27
|
-
constructor(options) {
|
|
28
|
-
this.rpcDeferred = new promise_util_1.Deferred();
|
|
29
|
-
this.isRpcInitialized = false;
|
|
30
|
-
Object.assign(this, options);
|
|
31
|
-
}
|
|
32
|
-
initializeRpc() {
|
|
33
|
-
// we need to set the flag to true before waiting for the channel provider. Otherwise `get` might
|
|
34
|
-
// get called again and we'll try to open a channel more than once
|
|
35
|
-
this.proxySynchronizer.startProxyInitialization(this.id, this.rpcDeferred.promise.then(() => { }));
|
|
36
|
-
this.isRpcInitialized = true;
|
|
37
|
-
const clientOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'clientOnly' };
|
|
38
|
-
this.channelProvider().then(channel => {
|
|
39
|
-
const rpc = new core_1.RpcProtocol(channel, undefined, clientOptions);
|
|
40
|
-
this.rpcDeferred.resolve(rpc);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
get(target, name, receiver) {
|
|
44
|
-
if (!this.isRpcInitialized) {
|
|
45
|
-
this.initializeRpc();
|
|
46
|
-
}
|
|
47
|
-
if (target[name] || name.charCodeAt(0) !== 36 /* CharCode.DollarSign */) {
|
|
48
|
-
return target[name];
|
|
49
|
-
}
|
|
50
|
-
const isNotify = this.isNotification(name);
|
|
51
|
-
return (...args) => {
|
|
52
|
-
const method = name.toString();
|
|
53
|
-
return this.sendWhenNoInit(async (connection) => {
|
|
54
|
-
if (isNotify) {
|
|
55
|
-
connection.sendNotification(method, args);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return await connection.sendRequest(method, args);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
sendWhenNoInit(send) {
|
|
64
|
-
return this.proxySynchronizer.pendingProxyInitializations().then(() => this.rpcDeferred.promise.then(send));
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Return whether the given property represents a notification. If true,
|
|
68
|
-
* the promise returned from the invocation will resolve immediately to `undefined`
|
|
69
|
-
*
|
|
70
|
-
* A property leads to a notification rather than a method call if its name
|
|
71
|
-
* begins with `notify` or `on`.
|
|
72
|
-
*
|
|
73
|
-
* @param p - The property being called on the proxy.
|
|
74
|
-
* @return Whether `p` represents a notification.
|
|
75
|
-
*/
|
|
76
|
-
isNotification(p) {
|
|
77
|
-
let propertyString = p.toString();
|
|
78
|
-
if (propertyString.charCodeAt(0) === 36 /* CharCode.DollarSign */) {
|
|
79
|
-
propertyString = propertyString.substring(1);
|
|
80
|
-
}
|
|
81
|
-
return propertyString.startsWith('notify') || propertyString.startsWith('on');
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.ClientProxyHandler = ClientProxyHandler;
|
|
85
|
-
class RpcInvocationHandler {
|
|
86
|
-
constructor(options) {
|
|
87
|
-
this.rpcDeferred = new promise_util_1.Deferred();
|
|
88
|
-
Object.assign(this, options);
|
|
89
|
-
}
|
|
90
|
-
listen(channel) {
|
|
91
|
-
const serverOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'serverOnly' };
|
|
92
|
-
const server = new core_1.RpcProtocol(channel, (method, args) => this.handleRequest(method, args), serverOptions);
|
|
93
|
-
server.onNotification((e) => this.onNotification(e.method, e.args));
|
|
94
|
-
this.rpcDeferred.resolve(server);
|
|
95
|
-
}
|
|
96
|
-
handleRequest(method, args) {
|
|
97
|
-
return this.rpcDeferred.promise.then(() => this.target[method](...args));
|
|
98
|
-
}
|
|
99
|
-
onNotification(method, args) {
|
|
100
|
-
this.rpcDeferred.promise.then(() => {
|
|
101
|
-
this.target[method](...args);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.RpcInvocationHandler = RpcInvocationHandler;
|
|
106
|
-
//# sourceMappingURL=proxy-handler.js.map
|