@theia/plugin-ext 1.23.0-next.2 → 1.23.0-next.26
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/character-classifier.js +2 -2
- package/lib/common/character-classifier.js.map +1 -1
- package/lib/common/index.js +1 -1
- package/lib/common/objects.js +3 -3
- package/lib/common/objects.js.map +1 -1
- package/lib/common/plugin-api-rpc-model.d.ts +12 -19
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +31 -13
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +64 -62
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +6 -0
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +6 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.js +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +3 -2
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +53 -68
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/plugin-worker.js +1 -1
- package/lib/hosted/browser/plugin-worker.js.map +1 -1
- package/lib/hosted/browser/worker/worker-main.js +4 -4
- package/lib/hosted/browser/worker/worker-main.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-cli-contribution.js +1 -1
- package/lib/hosted/node/hosted-plugin-cli-contribution.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +2 -0
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +25 -7
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +3 -3
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +9 -9
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.js +6 -6
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/metadata-scanner.js +2 -2
- package/lib/hosted/node/metadata-scanner.js.map +1 -1
- package/lib/hosted/node/plugin-ext-hosted-backend-module.js +2 -2
- package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +6 -6
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-reader.js +9 -8
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/plugin-service.js +9 -9
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/backend-init-theia.js +2 -1
- package/lib/hosted/node/scanners/backend-init-theia.js.map +1 -1
- package/lib/hosted/node/scanners/file-plugin-uri-factory.js +1 -1
- package/lib/hosted/node/scanners/file-plugin-uri-factory.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +1 -1
- 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 +9 -8
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/hosted/node-electron/plugin-ext-hosted-electron-backend-module.js +1 -1
- package/lib/hosted/node-electron/plugin-ext-hosted-electron-backend-module.js.map +1 -1
- package/lib/hosted/node-electron/scanner-theia-electron.js +1 -1
- package/lib/hosted/node-electron/scanner-theia-electron.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +18 -11
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +111 -67
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/commands.js +3 -3
- package/lib/main/browser/commands.js.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
- package/lib/main/browser/comments/comments-context-key-service.d.ts +1 -1
- package/lib/main/browser/comments/comments-context-key-service.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-context-key-service.js +3 -3
- package/lib/main/browser/comments/comments-context-key-service.js.map +1 -1
- package/lib/main/browser/comments/comments-contribution.js +8 -8
- package/lib/main/browser/comments/comments-contribution.js.map +1 -1
- package/lib/main/browser/comments/comments-decorator.js +1 -1
- package/lib/main/browser/comments/comments-decorator.js.map +1 -1
- package/lib/main/browser/comments/comments-main.js +1 -1
- package/lib/main/browser/comments/comments-main.js.map +1 -1
- package/lib/main/browser/comments/comments-service.js +1 -1
- package/lib/main/browser/comments/comments-service.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-contribution.js +2 -2
- package/lib/main/browser/custom-editors/custom-editor-contribution.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +3 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-service.js +1 -1
- package/lib/main/browser/custom-editors/custom-editor-service.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +3 -3
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/custom-editors/paths.js +1 -1
- package/lib/main/browser/custom-editors/paths.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +8 -8
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/custom-editors/undo-redo-service.js +1 -1
- package/lib/main/browser/custom-editors/undo-redo-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.js +4 -4
- package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +4 -4
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
- package/lib/main/browser/dialogs/modal-notification.js +4 -4
- package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
- package/lib/main/browser/dialogs-main.js.map +1 -1
- package/lib/main/browser/documents-main.js +1 -1
- package/lib/main/browser/documents-main.js.map +1 -1
- package/lib/main/browser/editor/untitled-resource.js +2 -2
- package/lib/main/browser/editor/untitled-resource.js.map +1 -1
- package/lib/main/browser/keybindings/keybindings-contribution-handler.js +2 -2
- package/lib/main/browser/keybindings/keybindings-contribution-handler.js.map +1 -1
- package/lib/main/browser/languages-main.js +12 -12
- 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 +3 -0
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/main-file-system-event-service.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +14 -14
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/output-channel-registry-main.js +2 -2
- package/lib/main/browser/output-channel-registry-main.js.map +1 -1
- package/lib/main/browser/plugin-authentication-service.d.ts +29 -0
- package/lib/main/browser/plugin-authentication-service.d.ts.map +1 -0
- package/lib/main/browser/plugin-authentication-service.js +81 -0
- package/lib/main/browser/plugin-authentication-service.js.map +1 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +23 -23
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-ext-deploy-command.js +4 -4
- package/lib/main/browser/plugin-ext-deploy-command.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 +14 -10
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/plugin-ext-widget.js +6 -6
- package/lib/main/browser/plugin-ext-widget.js.map +1 -1
- package/lib/main/browser/plugin-frontend-contribution.js +3 -3
- package/lib/main/browser/plugin-frontend-contribution.js.map +1 -1
- package/lib/main/browser/plugin-frontend-view-contribution.js +1 -1
- package/lib/main/browser/plugin-frontend-view-contribution.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +11 -11
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +1 -1
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/plugin-storage.js.map +1 -1
- package/lib/main/browser/quick-open-main.js +1 -1
- package/lib/main/browser/quick-open-main.js.map +1 -1
- package/lib/main/browser/scm-main.js.map +1 -1
- package/lib/main/browser/selection-provider-command.js +3 -3
- package/lib/main/browser/selection-provider-command.js.map +1 -1
- package/lib/main/browser/text-editor-main.js +1 -1
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/text-editor-model-service.js +3 -3
- package/lib/main/browser/text-editor-model-service.js.map +1 -1
- package/lib/main/browser/text-editors-main.js +9 -9
- package/lib/main/browser/text-editors-main.js.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +3 -3
- 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 +8 -4
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +74 -18
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.js +7 -7
- package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +16 -16
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/view/view-context-key-service.js +3 -3
- package/lib/main/browser/view/view-context-key-service.js.map +1 -1
- package/lib/main/browser/view-column-service.js +4 -4
- package/lib/main/browser/view-column-service.js.map +1 -1
- package/lib/main/browser/webview/webview-environment.js +3 -3
- package/lib/main/browser/webview/webview-environment.js.map +1 -1
- package/lib/main/browser/webview/webview-frontend-security-warnings.js +4 -4
- package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
- package/lib/main/browser/webview/webview-preferences.js +1 -1
- package/lib/main/browser/webview/webview-preferences.js.map +1 -1
- package/lib/main/browser/webview/webview-resource-cache.js +1 -1
- package/lib/main/browser/webview/webview-resource-cache.js.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts +2 -2
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js +5 -5
- package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
- package/lib/main/browser/webview/webview.js +17 -17
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts +46 -0
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -0
- package/lib/main/browser/webview-views/webview-views-main.js +127 -0
- package/lib/main/browser/webview-views/webview-views-main.js.map +1 -0
- package/lib/main/browser/webview-views/webview-views.d.ts +30 -0
- package/lib/main/browser/webview-views/webview-views.d.ts.map +1 -0
- package/lib/main/browser/webview-views/webview-views.js +23 -0
- package/lib/main/browser/webview-views/webview-views.js.map +1 -0
- package/lib/main/browser/webviews-main.js.map +1 -1
- package/lib/main/browser/window-state-main.js +1 -1
- package/lib/main/browser/window-state-main.js.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +2 -0
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/main/browser/workspace-main.js +6 -1
- package/lib/main/browser/workspace-main.js.map +1 -1
- package/lib/main/common/plugin-theia-environment.js +2 -2
- package/lib/main/common/plugin-theia-environment.js.map +1 -1
- package/lib/main/electron-browser/webview/electron-webview-widget-factory.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +3 -3
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +7 -7
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-cli-contribution.js +1 -1
- package/lib/main/node/plugin-cli-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-contribution.js +3 -3
- package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts +3 -1
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +24 -19
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.js +1 -1
- package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
- package/lib/main/node/plugin-github-resolver.js +1 -1
- package/lib/main/node/plugin-github-resolver.js.map +1 -1
- package/lib/main/node/plugin-http-resolver.js +1 -1
- package/lib/main/node/plugin-http-resolver.js.map +1 -1
- package/lib/main/node/plugin-server-handler.js +3 -3
- package/lib/main/node/plugin-server-handler.js.map +1 -1
- package/lib/main/node/plugin-service.js +2 -2
- package/lib/main/node/plugin-service.js.map +1 -1
- package/lib/main/node/plugin-theia-deployer-participant.js +2 -2
- package/lib/main/node/plugin-theia-deployer-participant.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +4 -4
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js +1 -1
- package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/resolvers/local-file-plugin-deployer-resolver.js +1 -1
- package/lib/main/node/resolvers/local-file-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.js +1 -1
- package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +23 -8
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.js +28 -24
- package/lib/plugin/authentication-ext.js.map +1 -1
- package/lib/plugin/comments.js +6 -6
- package/lib/plugin/comments.js.map +1 -1
- package/lib/plugin/decorations.js +1 -1
- package/lib/plugin/decorations.js.map +1 -1
- package/lib/plugin/document-data.js +4 -4
- package/lib/plugin/document-data.js.map +1 -1
- package/lib/plugin/documents.js +1 -1
- package/lib/plugin/documents.js.map +1 -1
- package/lib/plugin/editors-and-documents.js +6 -6
- package/lib/plugin/editors-and-documents.js.map +1 -1
- package/lib/plugin/env.js +2 -2
- package/lib/plugin/env.js.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.js +2 -2
- package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +1 -1
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/known-commands.js +17 -16
- package/lib/plugin/known-commands.js.map +1 -1
- package/lib/plugin/known-commands.spec.js +1 -1
- package/lib/plugin/known-commands.spec.js.map +1 -1
- package/lib/plugin/languages/completion.js.map +1 -1
- package/lib/plugin/languages/declaration.js +2 -2
- package/lib/plugin/languages/declaration.js.map +1 -1
- package/lib/plugin/languages/definition.js +2 -2
- package/lib/plugin/languages/definition.js.map +1 -1
- package/lib/plugin/languages/diagnostics.js +3 -3
- package/lib/plugin/languages/diagnostics.js.map +1 -1
- package/lib/plugin/languages/implementation.js +2 -2
- package/lib/plugin/languages/implementation.js.map +1 -1
- package/lib/plugin/languages/reference.js +1 -1
- package/lib/plugin/languages/reference.js.map +1 -1
- package/lib/plugin/languages/rename.js +1 -1
- package/lib/plugin/languages/rename.js.map +1 -1
- package/lib/plugin/languages/semantic-highlighting.js +4 -4
- package/lib/plugin/languages/semantic-highlighting.js.map +1 -1
- package/lib/plugin/languages/type-definition.js +2 -2
- package/lib/plugin/languages/type-definition.js.map +1 -1
- package/lib/plugin/languages.js +1 -1
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/node/debug/debug.js +7 -7
- package/lib/plugin/node/debug/debug.js.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +4 -4
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +1 -1
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts +34 -0
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts.map +1 -0
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js +45 -0
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js.map +1 -0
- package/lib/plugin/node/env-node-ext.js +2 -2
- package/lib/plugin/node/env-node-ext.js.map +1 -1
- package/lib/plugin/path.spec.js +3 -3
- package/lib/plugin/path.spec.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +62 -30
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-manager.js +7 -6
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/preference-registry.js +3 -3
- package/lib/plugin/preference-registry.js.map +1 -1
- package/lib/plugin/preferences/configuration.js +1 -1
- package/lib/plugin/preferences/configuration.js.map +1 -1
- package/lib/plugin/quick-open.js +1 -1
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/scm.js +1 -3
- package/lib/plugin/scm.js.map +1 -1
- package/lib/plugin/text-editor.js +10 -10
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/timeline.js.map +1 -1
- package/lib/plugin/type-converters.js +6 -5
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/type-converters.spec.js +5 -5
- package/lib/plugin/type-converters.spec.js.map +1 -1
- package/lib/plugin/types-impl.js +34 -32
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/webview-views.d.ts +68 -0
- package/lib/plugin/webview-views.d.ts.map +1 -0
- package/lib/plugin/webview-views.js +145 -0
- package/lib/plugin/webview-views.js.map +1 -0
- package/lib/plugin/webviews.d.ts +6 -0
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/webviews.js +29 -6
- package/lib/plugin/webviews.js.map +1 -1
- package/lib/plugin/workspace.d.ts +6 -0
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/lib/plugin/workspace.js +21 -3
- package/lib/plugin/workspace.js.map +1 -1
- package/lib/plugin-ext-backend-electron-module.js +2 -2
- package/lib/plugin-ext-backend-electron-module.js.map +1 -1
- package/lib/plugin-ext-backend-module.js +2 -2
- package/lib/plugin-ext-backend-module.js.map +1 -1
- package/package.json +23 -23
- package/src/common/plugin-api-rpc-model.ts +12 -17
- package/src/common/plugin-api-rpc.ts +43 -13
- package/src/common/plugin-protocol.ts +7 -0
- package/src/hosted/browser/hosted-plugin.ts +20 -40
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +23 -3
- package/src/hosted/node/plugin-reader.ts +2 -1
- package/src/hosted/node/scanners/scanner-theia.ts +2 -1
- package/src/main/browser/authentication-main.ts +137 -81
- package/src/main/browser/main-context.ts +4 -0
- package/src/main/browser/plugin-authentication-service.ts +71 -0
- package/src/main/browser/plugin-ext-frontend-module.ts +13 -8
- package/src/main/browser/view/plugin-view-registry.ts +73 -5
- package/src/main/browser/view-column-service.ts +1 -1
- package/src/main/browser/webview-views/webview-views-main.ts +142 -0
- package/src/main/browser/webview-views/webview-views.ts +38 -0
- package/src/main/browser/workspace-main.ts +9 -1
- package/src/main/electron-browser/webview/electron-webview-widget-factory.ts +2 -2
- package/src/main/node/paths/plugin-paths-service.ts +1 -1
- package/src/main/node/plugin-deployer-impl.ts +11 -7
- package/src/plugin/authentication-ext.ts +42 -32
- package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +1 -1
- package/src/plugin/node/debug/plugin-inline-debug-adapter.ts +47 -0
- package/src/plugin/plugin-context.ts +44 -3
- package/src/plugin/plugin-manager.ts +2 -1
- package/src/plugin/webview-views.ts +213 -0
- package/src/plugin/webviews.ts +30 -0
- package/src/plugin/workspace.ts +23 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2022 EclipseSource 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 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { AuthenticationProvider, AuthenticationService, AuthenticationServiceImpl, AuthenticationSession } from '@theia/core/lib/browser/authentication-service';
|
|
18
|
+
import { inject } from '@theia/core/shared/inversify';
|
|
19
|
+
import { Deferred, timeoutReject } from '@theia/core/lib/common/promise-util';
|
|
20
|
+
import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
|
|
21
|
+
|
|
22
|
+
export function getAuthenticationProviderActivationEvent(id: string): string { return `onAuthenticationRequest:${id}`; }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Plugin authentiction service that aims to activate additional plugins if sessions are created or queried.
|
|
26
|
+
*/
|
|
27
|
+
export class PluginAuthenticationServiceImpl extends AuthenticationServiceImpl implements AuthenticationService {
|
|
28
|
+
@inject(HostedPluginSupport) protected readonly pluginService: HostedPluginSupport;
|
|
29
|
+
|
|
30
|
+
async getSessions(id: string, scopes?: string[]): Promise<ReadonlyArray<AuthenticationSession>> {
|
|
31
|
+
await this.tryActivateProvider(id);
|
|
32
|
+
return super.getSessions(id, scopes);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async login(id: string, scopes: string[]): Promise<AuthenticationSession> {
|
|
36
|
+
await this.tryActivateProvider(id);
|
|
37
|
+
return super.login(id, scopes);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected async tryActivateProvider(providerId: string): Promise<AuthenticationProvider> {
|
|
41
|
+
this.pluginService.activateByEvent(getAuthenticationProviderActivationEvent(providerId));
|
|
42
|
+
|
|
43
|
+
const provider = this.authenticationProviders.get(providerId);
|
|
44
|
+
if (provider) {
|
|
45
|
+
return provider;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// When activate has completed, the extension has made the call to `registerAuthenticationProvider`.
|
|
49
|
+
// However, activate cannot block on this, so the renderer may not have gotten the event yet.
|
|
50
|
+
return Promise.race([
|
|
51
|
+
this.waitForProviderRegistration(providerId),
|
|
52
|
+
timeoutReject<AuthenticationProvider>(5000, 'Timed out waiting for authentication provider to register')
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected async waitForProviderRegistration(providerId: string): Promise<AuthenticationProvider> {
|
|
57
|
+
const waitForRegistration = new Deferred<AuthenticationProvider>();
|
|
58
|
+
const registration = this.onDidRegisterAuthenticationProvider(info => {
|
|
59
|
+
if (info.id === providerId) {
|
|
60
|
+
registration.dispose();
|
|
61
|
+
const provider = this.authenticationProviders.get(providerId);
|
|
62
|
+
if (provider) {
|
|
63
|
+
waitForRegistration.resolve(provider);
|
|
64
|
+
} else {
|
|
65
|
+
waitForRegistration.reject(new Error(`No authentication provider '${providerId}' is currently registered.`));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return waitForRegistration.promise;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -21,7 +21,7 @@ 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,
|
|
24
|
+
ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution
|
|
25
25
|
} from '@theia/core/lib/browser';
|
|
26
26
|
import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider } from '@theia/core/lib/common';
|
|
27
27
|
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
|
|
@@ -76,6 +76,8 @@ import { CustomEditorWidget } from './custom-editors/custom-editor-widget';
|
|
|
76
76
|
import { CustomEditorService } from './custom-editors/custom-editor-service';
|
|
77
77
|
import { UndoRedoService } from './custom-editors/undo-redo-service';
|
|
78
78
|
import { WebviewFrontendSecurityWarnings } from './webview/webview-frontend-security-warnings';
|
|
79
|
+
import { PluginAuthenticationServiceImpl } from './plugin-authentication-service';
|
|
80
|
+
import { AuthenticationService } from '@theia/core/lib/browser/authentication-service';
|
|
79
81
|
|
|
80
82
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
81
83
|
|
|
@@ -145,21 +147,21 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
145
147
|
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
146
148
|
id: PLUGIN_VIEW_DATA_FACTORY_ID,
|
|
147
149
|
createWidget: (identifier: TreeViewWidgetIdentifier) => {
|
|
148
|
-
const
|
|
150
|
+
const props = {
|
|
149
151
|
contextMenuPath: VIEW_ITEM_CONTEXT_MENU,
|
|
150
152
|
expandOnlyOnExpansionToggleClick: true,
|
|
151
153
|
expansionTogglePadding: 22,
|
|
152
154
|
globalSelection: true,
|
|
153
155
|
leftPadding: 8,
|
|
154
156
|
search: true
|
|
157
|
+
};
|
|
158
|
+
const child = createTreeContainer(container, {
|
|
159
|
+
props,
|
|
160
|
+
tree: PluginTree,
|
|
161
|
+
model: PluginTreeModel,
|
|
162
|
+
widget: TreeViewWidget,
|
|
155
163
|
});
|
|
156
164
|
child.bind(TreeViewWidgetIdentifier).toConstantValue(identifier);
|
|
157
|
-
child.bind(PluginTree).toSelf();
|
|
158
|
-
child.rebind(TreeImpl).toService(PluginTree);
|
|
159
|
-
child.bind(PluginTreeModel).toSelf();
|
|
160
|
-
child.rebind(TreeModelImpl).toService(PluginTreeModel);
|
|
161
|
-
child.bind(TreeViewWidget).toSelf();
|
|
162
|
-
child.rebind(TreeWidget).toService(TreeViewWidget);
|
|
163
165
|
return child.get(TreeWidget);
|
|
164
166
|
}
|
|
165
167
|
})).inSingletonScope();
|
|
@@ -234,4 +236,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
234
236
|
|
|
235
237
|
bind(WebviewFrontendSecurityWarnings).toSelf().inSingletonScope();
|
|
236
238
|
bind(FrontendApplicationContribution).toService(WebviewFrontendSecurityWarnings);
|
|
239
|
+
|
|
240
|
+
bind(PluginAuthenticationServiceImpl).toSelf().inSingletonScope();
|
|
241
|
+
rebind(AuthenticationService).toService(PluginAuthenticationServiceImpl);
|
|
237
242
|
});
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
ViewContainerIdentifier, ViewContainerTitleOptions, Widget, FrontendApplicationContribution,
|
|
21
21
|
StatefulWidget, CommonMenus, BaseWidget, TreeViewWelcomeWidget, codicon, ViewContainerPart
|
|
22
22
|
} from '@theia/core/lib/browser';
|
|
23
|
-
import { ViewContainer, View, ViewWelcome } from '../../../common';
|
|
23
|
+
import { ViewContainer, View, ViewWelcome, PluginViewType } from '../../../common';
|
|
24
24
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
25
25
|
import { DebugWidget } from '@theia/debug/lib/browser/view/debug-widget';
|
|
26
26
|
import { PluginViewWidget, PluginViewWidgetIdentifier } from './plugin-view-widget';
|
|
@@ -31,7 +31,7 @@ import { DebugFrontendApplicationContribution } from '@theia/debug/lib/browser/d
|
|
|
31
31
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
32
32
|
import { CommandRegistry } from '@theia/core/lib/common/command';
|
|
33
33
|
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
|
34
|
-
import { Emitter } from '@theia/core/lib/common/event';
|
|
34
|
+
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
35
35
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
36
36
|
import { ViewContextKeyService } from './view-context-key-service';
|
|
37
37
|
import { PROBLEMS_WIDGET_ID } from '@theia/markers/lib/browser/problem/problem-widget';
|
|
@@ -41,6 +41,11 @@ import { TERMINAL_WIDGET_FACTORY_ID } from '@theia/terminal/lib/browser/terminal
|
|
|
41
41
|
import { TreeViewWidget } from './tree-view-widget';
|
|
42
42
|
import { SEARCH_VIEW_CONTAINER_ID } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
|
|
43
43
|
|
|
44
|
+
import { WebviewView, WebviewViewResolver } from '../webview-views/webview-views';
|
|
45
|
+
import { WebviewWidget, WebviewWidgetIdentifier } from '../webview/webview';
|
|
46
|
+
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
47
|
+
import { v4 } from 'uuid';
|
|
48
|
+
|
|
44
49
|
export const PLUGIN_VIEW_FACTORY_ID = 'plugin-view';
|
|
45
50
|
export const PLUGIN_VIEW_CONTAINER_FACTORY_ID = 'plugin-view-container';
|
|
46
51
|
export const PLUGIN_VIEW_DATA_FACTORY_ID = 'plugin-view-data';
|
|
@@ -95,6 +100,8 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
95
100
|
private readonly viewDataProviders = new Map<string, ViewDataProvider>();
|
|
96
101
|
private readonly viewDataState = new Map<string, object>();
|
|
97
102
|
|
|
103
|
+
private readonly webviewViewResolvers = new Map<string, WebviewViewResolver>();
|
|
104
|
+
|
|
98
105
|
@postConstruct()
|
|
99
106
|
protected init(): void {
|
|
100
107
|
// VS Code Viewlets
|
|
@@ -333,6 +340,63 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
333
340
|
return toDispose;
|
|
334
341
|
}
|
|
335
342
|
|
|
343
|
+
async registerWebviewView(viewId: string, resolver: WebviewViewResolver): Promise<Disposable> {
|
|
344
|
+
if (this.webviewViewResolvers.has(viewId)) {
|
|
345
|
+
throw new Error(`View resolver already registered for ${viewId}`);
|
|
346
|
+
}
|
|
347
|
+
this.webviewViewResolvers.set(viewId, resolver);
|
|
348
|
+
|
|
349
|
+
const webviewView = await this.createNewWebviewView();
|
|
350
|
+
const token = CancellationToken.None;
|
|
351
|
+
this.getView(viewId).then(async view => {
|
|
352
|
+
if (view) {
|
|
353
|
+
if (view.isVisible) {
|
|
354
|
+
await this.prepareView(view, webviewView.webview.identifier.id);
|
|
355
|
+
} else {
|
|
356
|
+
const toDisposeOnDidExpandView = new DisposableCollection(this.onDidExpandView(async id => {
|
|
357
|
+
if (id === viewId) {
|
|
358
|
+
dispose();
|
|
359
|
+
await this.prepareView(view, webviewView.webview.identifier.id);
|
|
360
|
+
}
|
|
361
|
+
}));
|
|
362
|
+
const dispose = () => toDisposeOnDidExpandView.dispose();
|
|
363
|
+
view.disposed.connect(dispose);
|
|
364
|
+
toDisposeOnDidExpandView.push(Disposable.create(() => view.disposed.disconnect(dispose)));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
resolver.resolve(webviewView, token);
|
|
370
|
+
|
|
371
|
+
return Disposable.create(() => {
|
|
372
|
+
this.webviewViewResolvers.delete(viewId);
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
async createNewWebviewView(): Promise<WebviewView> {
|
|
377
|
+
const webview = await this.widgetManager.getOrCreateWidget<WebviewWidget>(
|
|
378
|
+
WebviewWidget.FACTORY_ID, <WebviewWidgetIdentifier>{ id: v4() });
|
|
379
|
+
webview.setContentOptions({ allowScripts: true });
|
|
380
|
+
|
|
381
|
+
let _description: string | undefined;
|
|
382
|
+
|
|
383
|
+
return {
|
|
384
|
+
webview,
|
|
385
|
+
|
|
386
|
+
get onDidChangeVisibility(): Event<boolean> { return webview.onDidChangeVisibility; },
|
|
387
|
+
get onDidDispose(): Event<void> { return webview.onDidDispose; },
|
|
388
|
+
|
|
389
|
+
get title(): string | undefined { return webview.title.label; },
|
|
390
|
+
set title(value: string | undefined) { webview.title.label = value || ''; },
|
|
391
|
+
|
|
392
|
+
get description(): string | undefined { return _description; },
|
|
393
|
+
set description(value: string | undefined) { _description = value; },
|
|
394
|
+
|
|
395
|
+
dispose: webview.dispose,
|
|
396
|
+
show: webview.show
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
336
400
|
registerViewWelcome(viewWelcome: ViewWelcome): Disposable {
|
|
337
401
|
const toDispose = new DisposableCollection();
|
|
338
402
|
|
|
@@ -409,7 +473,7 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
409
473
|
return this.getView(viewId);
|
|
410
474
|
}
|
|
411
475
|
|
|
412
|
-
protected async prepareView(widget: PluginViewWidget): Promise<void> {
|
|
476
|
+
protected async prepareView(widget: PluginViewWidget, webviewId?: string): Promise<void> {
|
|
413
477
|
const data = this.views.get(widget.options.viewId);
|
|
414
478
|
if (!data) {
|
|
415
479
|
return;
|
|
@@ -419,7 +483,7 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
419
483
|
widget.title.label = view.name;
|
|
420
484
|
}
|
|
421
485
|
const currentDataWidget = widget.widgets[0];
|
|
422
|
-
const viewDataWidget = await this.createViewDataWidget(view.id);
|
|
486
|
+
const viewDataWidget = await this.createViewDataWidget(view.id, webviewId);
|
|
423
487
|
if (widget.isDisposed) {
|
|
424
488
|
// eslint-disable-next-line no-unused-expressions
|
|
425
489
|
viewDataWidget?.dispose();
|
|
@@ -701,8 +765,12 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
701
765
|
return toDispose;
|
|
702
766
|
}
|
|
703
767
|
|
|
704
|
-
protected async createViewDataWidget(viewId: string): Promise<Widget | undefined> {
|
|
768
|
+
protected async createViewDataWidget(viewId: string, webviewId?: string): Promise<Widget | undefined> {
|
|
705
769
|
const view = this.views.get(viewId);
|
|
770
|
+
if (view?.[1]?.type === PluginViewType.Webview) {
|
|
771
|
+
const webviewWidget = this.widgetManager.getWidget(WebviewWidget.FACTORY_ID, <WebviewWidgetIdentifier>{ id: webviewId });
|
|
772
|
+
return webviewWidget;
|
|
773
|
+
}
|
|
706
774
|
const provider = this.viewDataProviders.get(viewId);
|
|
707
775
|
if (!view || !provider) {
|
|
708
776
|
return undefined;
|
|
@@ -32,7 +32,7 @@ export class ViewColumnService {
|
|
|
32
32
|
) {
|
|
33
33
|
let oldColumnValues = new Map<string, number>();
|
|
34
34
|
const update = async () => {
|
|
35
|
-
await new Promise((resolve => setTimeout(
|
|
35
|
+
await new Promise<void>((resolve => setTimeout(resolve)));
|
|
36
36
|
this.updateViewColumns();
|
|
37
37
|
this.viewColumnIds.forEach((ids: string[], viewColumn: number) => {
|
|
38
38
|
ids.forEach((id: string) => {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 SAP SE or an SAP affiliate company 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 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
/*---------------------------------------------------------------------------------------------
|
|
17
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
+
*--------------------------------------------------------------------------------------------*/
|
|
20
|
+
// some code copied and modified from https://github.com/microsoft/vscode/blob/e1f0f8f51390dea5df9096718fb6b647ed5a9534/src/vs/workbench/api/browser/mainThreadWebviewViews.ts
|
|
21
|
+
|
|
22
|
+
import { inject, interfaces } from '@theia/core/shared/inversify';
|
|
23
|
+
import { WebviewViewsMain, MAIN_RPC_CONTEXT, WebviewViewsExt } from '../../../common/plugin-api-rpc';
|
|
24
|
+
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
25
|
+
import { Disposable, DisposableCollection, ILogger } from '@theia/core';
|
|
26
|
+
import { WebviewView } from './webview-views';
|
|
27
|
+
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
28
|
+
import { WebviewsMainImpl } from '../webviews-main';
|
|
29
|
+
import { Widget, WidgetManager } from '@theia/core/lib/browser';
|
|
30
|
+
import { PluginViewRegistry } from '../view/plugin-view-registry';
|
|
31
|
+
|
|
32
|
+
export class WebviewViewsMainImpl implements WebviewViewsMain, Disposable {
|
|
33
|
+
|
|
34
|
+
protected readonly proxy: WebviewViewsExt;
|
|
35
|
+
protected readonly toDispose = new DisposableCollection(
|
|
36
|
+
Disposable.create(() => { /* mark as not disposed */ })
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
protected readonly webviewViews = new Map<string, WebviewView>();
|
|
40
|
+
protected readonly webviewViewProviders = new Map<string, Disposable>();
|
|
41
|
+
protected readonly widgetManager: WidgetManager;
|
|
42
|
+
protected readonly pluginViewRegistry: PluginViewRegistry;
|
|
43
|
+
|
|
44
|
+
@inject(ILogger)
|
|
45
|
+
protected readonly logger: ILogger;
|
|
46
|
+
|
|
47
|
+
constructor(rpc: RPCProtocol,
|
|
48
|
+
container: interfaces.Container,
|
|
49
|
+
readonly webviewsMain: WebviewsMainImpl
|
|
50
|
+
) {
|
|
51
|
+
this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.WEBVIEW_VIEWS_EXT);
|
|
52
|
+
this.widgetManager = container.get(WidgetManager);
|
|
53
|
+
this.pluginViewRegistry = container.get(PluginViewRegistry);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dispose(): void {
|
|
57
|
+
this.toDispose.dispose();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async $registerWebviewViewProvider(viewType: string, options: { retainContextWhenHidden?: boolean, serializeBuffersForPostMessage: boolean }): Promise<void> {
|
|
61
|
+
|
|
62
|
+
if (this.webviewViewProviders.has(viewType)) {
|
|
63
|
+
throw new Error(`View provider for ${viewType} already registered`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const registration = await this.pluginViewRegistry.registerWebviewView(viewType, {
|
|
67
|
+
resolve: async (webviewView: WebviewView, cancellation: CancellationToken) => {
|
|
68
|
+
const handle = webviewView.webview.identifier.id;
|
|
69
|
+
this.webviewViews.set(handle, webviewView);
|
|
70
|
+
this.webviewsMain.hookWebview(webviewView.webview);
|
|
71
|
+
|
|
72
|
+
let state: string | undefined;
|
|
73
|
+
if (webviewView.webview.state) {
|
|
74
|
+
try {
|
|
75
|
+
state = JSON.parse(webviewView.webview.state);
|
|
76
|
+
console.log(state);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.error('Could not load webview state', e, webviewView.webview.state);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (options) {
|
|
82
|
+
webviewView.webview.options = options;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
webviewView.onDidChangeVisibility(visible => {
|
|
86
|
+
this.proxy.$onDidChangeWebviewViewVisibility(handle, visible);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
webviewView.onDidDispose(() => {
|
|
90
|
+
this.proxy.$disposeWebviewView(handle);
|
|
91
|
+
this.webviewViews.delete(handle);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
this.proxy.$resolveWebviewView(handle, viewType, webviewView.title, state, cancellation);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
this.logger.error(`Error resolving webview view '${viewType}': ${error}`);
|
|
98
|
+
webviewView.webview.setHTML('failed to load plugin webview view');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
this.webviewViewProviders.set(viewType, registration);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
protected getWebview(handle: string): Widget | undefined {
|
|
107
|
+
return this.widgetManager.tryGetWidget(handle);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
$unregisterWebviewViewProvider(viewType: string): void {
|
|
111
|
+
const provider = this.webviewViewProviders.get(viewType);
|
|
112
|
+
if (!provider) {
|
|
113
|
+
throw new Error(`No view provider for ${viewType} registered`);
|
|
114
|
+
}
|
|
115
|
+
provider.dispose();
|
|
116
|
+
this.webviewViewProviders.delete(viewType);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
$setWebviewViewTitle(handle: string, value: string | undefined): void {
|
|
120
|
+
const webviewView = this.getWebviewView(handle);
|
|
121
|
+
webviewView.title = value;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
$setWebviewViewDescription(handle: string, value: string | undefined): void {
|
|
125
|
+
const webviewView = this.getWebviewView(handle);
|
|
126
|
+
webviewView.description = value;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
$show(handle: string, preserveFocus: boolean): void {
|
|
130
|
+
const webviewView = this.getWebviewView(handle);
|
|
131
|
+
webviewView.show(preserveFocus);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
protected getWebviewView(handle: string): WebviewView {
|
|
135
|
+
const webviewView = this.webviewViews.get(handle);
|
|
136
|
+
if (!webviewView) {
|
|
137
|
+
throw new Error(`No webview view registered for handle '${handle}'`);
|
|
138
|
+
}
|
|
139
|
+
return webviewView;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 SAP SE or an SAP affiliate company 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 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
/*---------------------------------------------------------------------------------------------
|
|
17
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
+
*--------------------------------------------------------------------------------------------*/
|
|
20
|
+
// copied and modified from https://github.com/microsoft/vscode/blob/a4a4cf5ace4472bc4f5176396bb290cafa15c518/src/vs/workbench/contrib/webviewView/browser/webviewViewService.ts
|
|
21
|
+
|
|
22
|
+
import { CancellationToken, Event } from '@theia/core/lib/common';
|
|
23
|
+
import { WebviewWidget } from '../webview/webview';
|
|
24
|
+
|
|
25
|
+
export interface WebviewView {
|
|
26
|
+
title?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
readonly webview: WebviewWidget;
|
|
29
|
+
readonly onDidChangeVisibility: Event<boolean>;
|
|
30
|
+
readonly onDidDispose: Event<void>;
|
|
31
|
+
|
|
32
|
+
dispose(): void;
|
|
33
|
+
show(preserveFocus: boolean): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface WebviewViewResolver {
|
|
37
|
+
resolve(webviewView: WebviewView, cancellation: CancellationToken): Promise<void>;
|
|
38
|
+
}
|
|
@@ -22,7 +22,7 @@ import { URI as Uri } from '@theia/core/shared/vscode-uri';
|
|
|
22
22
|
import { UriComponents } from '../../common/uri-components';
|
|
23
23
|
import { FileSearchService } from '@theia/file-search/lib/common/file-search-service';
|
|
24
24
|
import URI from '@theia/core/lib/common/uri';
|
|
25
|
-
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
25
|
+
import { WorkspaceService, WorkspaceTrustService } from '@theia/workspace/lib/browser';
|
|
26
26
|
import { Resource } from '@theia/core/lib/common/resource';
|
|
27
27
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
28
28
|
import { Emitter, Event, ResourceResolver, CancellationToken } from '@theia/core';
|
|
@@ -52,6 +52,8 @@ export class WorkspaceMainImpl implements WorkspaceMain, Disposable {
|
|
|
52
52
|
|
|
53
53
|
private workspaceService: WorkspaceService;
|
|
54
54
|
|
|
55
|
+
private workspaceTrustService: WorkspaceTrustService;
|
|
56
|
+
|
|
55
57
|
private fsPreferences: FileSystemPreferences;
|
|
56
58
|
|
|
57
59
|
protected readonly toDispose = new DisposableCollection();
|
|
@@ -67,6 +69,7 @@ export class WorkspaceMainImpl implements WorkspaceMain, Disposable {
|
|
|
67
69
|
this.resourceResolver = container.get(TextContentResourceResolver);
|
|
68
70
|
this.pluginServer = container.get(PluginServer);
|
|
69
71
|
this.workspaceService = container.get(WorkspaceService);
|
|
72
|
+
this.workspaceTrustService = container.get(WorkspaceTrustService);
|
|
70
73
|
this.fsPreferences = container.get(FileSystemPreferences);
|
|
71
74
|
|
|
72
75
|
this.processWorkspaceFoldersChanged(this.workspaceService.tryGetRoots().map(root => root.resource.toString()));
|
|
@@ -76,6 +79,8 @@ export class WorkspaceMainImpl implements WorkspaceMain, Disposable {
|
|
|
76
79
|
this.toDispose.push(this.workspaceService.onWorkspaceLocationChanged(stat => {
|
|
77
80
|
this.proxy.$onWorkspaceLocationChanged(stat);
|
|
78
81
|
}));
|
|
82
|
+
|
|
83
|
+
this.workspaceTrustService.getWorkspaceTrust().then(trust => this.proxy.$onWorkspaceTrustChanged(trust));
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
dispose(): void {
|
|
@@ -269,6 +274,9 @@ export class WorkspaceMainImpl implements WorkspaceMain, Disposable {
|
|
|
269
274
|
await this.workspaceService.spliceRoots(start, deleteCount, ...rootsToAdd.map(root => new URI(root)));
|
|
270
275
|
}
|
|
271
276
|
|
|
277
|
+
async $requestWorkspaceTrust(_options?: theia.WorkspaceTrustRequestOptions): Promise<boolean | undefined> {
|
|
278
|
+
return this.workspaceTrustService.requestWorkspaceTrust();
|
|
279
|
+
}
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
/**
|
|
@@ -35,7 +35,7 @@ export class ElectronWebviewWidgetFactory extends WebviewWidgetFactory {
|
|
|
35
35
|
* @param endpoint cookie's target url
|
|
36
36
|
*/
|
|
37
37
|
protected async attachElectronSecurityCookie(endpoint: string): Promise<void> {
|
|
38
|
-
await electronRemote.session.defaultSession
|
|
38
|
+
await electronRemote.session.defaultSession.cookies.set({
|
|
39
39
|
url: endpoint,
|
|
40
40
|
name: ElectronSecurityToken,
|
|
41
41
|
value: JSON.stringify(this.container.get(ElectronSecurityToken)),
|
|
@@ -59,7 +59,7 @@ export class ElectronCustomEditorWidgetFactory extends CustomEditorWidgetFactory
|
|
|
59
59
|
* @param endpoint cookie's target url
|
|
60
60
|
*/
|
|
61
61
|
protected async attachElectronSecurityCookie(endpoint: string): Promise<void> {
|
|
62
|
-
await electronRemote.session.defaultSession
|
|
62
|
+
await electronRemote.session.defaultSession.cookies.set({
|
|
63
63
|
url: endpoint,
|
|
64
64
|
name: ElectronSecurityToken,
|
|
65
65
|
value: JSON.stringify(this.container.get(ElectronSecurityToken)),
|
|
@@ -142,7 +142,7 @@ export class PluginPathsServiceImpl implements PluginPathsService {
|
|
|
142
142
|
|
|
143
143
|
private async cleanupOldLogs(parentLogsDir: string): Promise<void> {
|
|
144
144
|
// @ts-ignore - fs-extra types (Even latest version) is not updated with the `withFileTypes` option.
|
|
145
|
-
const dirEntries = await readdir(parentLogsDir, { withFileTypes: true });
|
|
145
|
+
const dirEntries = await readdir(parentLogsDir, { withFileTypes: true }) as string[];
|
|
146
146
|
// `Dirent` type is defined in @types/node since 10.10.0
|
|
147
147
|
// However, upgrading the @types/node in theia to 10.11 (as defined in engine field)
|
|
148
148
|
// Causes other packages to break in compilation, so we are using the infamous `any` type...
|
|
@@ -33,7 +33,7 @@ import { PluginDeployerFileHandlerContextImpl } from './plugin-deployer-file-han
|
|
|
33
33
|
import { PluginDeployerDirectoryHandlerContextImpl } from './plugin-deployer-directory-handler-context-impl';
|
|
34
34
|
import { ILogger, Emitter, ContributionProvider } from '@theia/core';
|
|
35
35
|
import { PluginCliContribution } from './plugin-cli-contribution';
|
|
36
|
-
import {
|
|
36
|
+
import { Measurement, Stopwatch } from '@theia/core/lib/common';
|
|
37
37
|
|
|
38
38
|
@injectable()
|
|
39
39
|
export class PluginDeployerImpl implements PluginDeployer {
|
|
@@ -50,6 +50,9 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
50
50
|
@inject(PluginCliContribution)
|
|
51
51
|
protected readonly cliContribution: PluginCliContribution;
|
|
52
52
|
|
|
53
|
+
@inject(Stopwatch)
|
|
54
|
+
protected readonly stopwatch: Stopwatch;
|
|
55
|
+
|
|
53
56
|
/**
|
|
54
57
|
* Inject all plugin resolvers found at runtime.
|
|
55
58
|
*/
|
|
@@ -117,7 +120,7 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
const
|
|
123
|
+
const deployPlugins = this.measure('deployPlugins');
|
|
121
124
|
const unresolvedUserEntries = context.userEntries.map(id => ({
|
|
122
125
|
id,
|
|
123
126
|
type: PluginType.User
|
|
@@ -127,8 +130,9 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
127
130
|
type: PluginType.System
|
|
128
131
|
}));
|
|
129
132
|
const plugins = await this.resolvePlugins([...unresolvedUserEntries, ...unresolvedSystemEntries]);
|
|
133
|
+
deployPlugins.log('Resolve plugins list');
|
|
130
134
|
await this.deployPlugins(plugins);
|
|
131
|
-
|
|
135
|
+
deployPlugins.log('Deploy plugins list');
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
async undeploy(pluginId: string): Promise<void> {
|
|
@@ -138,9 +142,9 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
138
142
|
}
|
|
139
143
|
|
|
140
144
|
async deploy(plugin: UnresolvedPluginEntry): Promise<void> {
|
|
141
|
-
const
|
|
145
|
+
const deploy = this.measure('deploy');
|
|
142
146
|
await this.deployMultipleEntries([plugin]);
|
|
143
|
-
|
|
147
|
+
deploy.log(`Deploy plugin ${plugin}`);
|
|
144
148
|
}
|
|
145
149
|
|
|
146
150
|
protected async deployMultipleEntries(plugins: UnresolvedPluginEntry[]): Promise<void> {
|
|
@@ -310,7 +314,7 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
310
314
|
return pluginDeployerEntries;
|
|
311
315
|
}
|
|
312
316
|
|
|
313
|
-
protected
|
|
314
|
-
|
|
317
|
+
protected measure(name: string): Measurement {
|
|
318
|
+
return this.stopwatch.start(name);
|
|
315
319
|
}
|
|
316
320
|
}
|