@theia/plugin-ext 1.23.0-next.3 → 1.23.0-next.35
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 +13 -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 +33 -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.d.ts.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.d.ts.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.d.ts.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/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/dialogs/modal-notification.d.ts.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.d.ts +1 -0
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +23 -15
- 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.d.ts.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.d.ts.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.d.ts +0 -2
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +16 -18
- 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.d.ts.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.d.ts.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/code-action.d.ts +7 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.js +36 -2
- package/lib/plugin/languages/code-action.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.d.ts +2 -0
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +8 -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-session.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.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.d.ts.map +1 -1
- 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 +76 -32
- 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.d.ts.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/status-bar/status-bar-item.d.ts +3 -2
- package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
- package/lib/plugin/status-bar/status-bar-item.js +5 -2
- package/lib/plugin/status-bar/status-bar-item.js.map +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
- package/lib/plugin/status-bar-message-registry.js +2 -2
- package/lib/plugin/status-bar-message-registry.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.d.ts.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 +13 -17
- package/src/common/plugin-api-rpc.ts +46 -14
- 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/hosted/node-electron/scanner-theia-electron.ts +1 -1
- package/src/main/browser/authentication-main.ts +137 -81
- package/src/main/browser/comments/comment-thread-widget.tsx +12 -12
- package/src/main/browser/custom-editors/custom-editor-widget.ts +5 -5
- package/src/main/browser/debug/plugin-debug-session-factory.ts +22 -22
- package/src/main/browser/dialogs/modal-notification.ts +1 -1
- package/src/main/browser/languages-main.ts +13 -3
- 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/plugin-ext-widget.tsx +1 -1
- package/src/main/browser/view/plugin-view-registry.ts +73 -5
- package/src/main/browser/view/plugin-view-widget.ts +4 -4
- package/src/main/browser/view/tree-view-widget.tsx +14 -17
- package/src/main/browser/view-column-service.ts +1 -1
- package/src/main/browser/webview/webview.ts +5 -5
- 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 +4 -4
- 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/languages/code-action.ts +46 -3
- package/src/plugin/languages.ts +9 -0
- package/src/plugin/node/debug/plugin-debug-adapter-session.ts +7 -7
- 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/node/env-node-ext.ts +1 -1
- package/src/plugin/plugin-context.ts +64 -9
- package/src/plugin/plugin-manager.ts +2 -1
- package/src/plugin/quick-open.ts +13 -11
- package/src/plugin/status-bar/status-bar-item.ts +8 -2
- package/src/plugin/status-bar-message-registry.ts +3 -2
- package/src/plugin/types-impl.ts +8 -8
- package/src/plugin/webview-views.ts +213 -0
- package/src/plugin/webviews.ts +30 -0
- package/src/plugin/workspace.ts +23 -0
|
@@ -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
|
/**
|
|
@@ -23,7 +23,7 @@ import { CustomEditorWidget } from '../../browser/custom-editors/custom-editor-w
|
|
|
23
23
|
|
|
24
24
|
export class ElectronWebviewWidgetFactory extends WebviewWidgetFactory {
|
|
25
25
|
|
|
26
|
-
async createWidget(identifier: WebviewWidgetIdentifier): Promise<WebviewWidget> {
|
|
26
|
+
override async createWidget(identifier: WebviewWidgetIdentifier): Promise<WebviewWidget> {
|
|
27
27
|
const widget = await super.createWidget(identifier);
|
|
28
28
|
await this.attachElectronSecurityCookie(widget.externalEndpoint);
|
|
29
29
|
return widget;
|
|
@@ -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)),
|
|
@@ -47,7 +47,7 @@ export class ElectronWebviewWidgetFactory extends WebviewWidgetFactory {
|
|
|
47
47
|
|
|
48
48
|
export class ElectronCustomEditorWidgetFactory extends CustomEditorWidgetFactory {
|
|
49
49
|
|
|
50
|
-
async createWidget(identifier: WebviewWidgetIdentifier): Promise<CustomEditorWidget> {
|
|
50
|
+
override async createWidget(identifier: WebviewWidgetIdentifier): Promise<CustomEditorWidget> {
|
|
51
51
|
const widget = await super.createWidget(identifier);
|
|
52
52
|
await this.attachElectronSecurityCookie(widget.externalEndpoint);
|
|
53
53
|
return widget;
|
|
@@ -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
|
}
|
|
@@ -28,8 +28,7 @@ import {
|
|
|
28
28
|
} from '../common/plugin-api-rpc';
|
|
29
29
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
30
30
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
31
|
-
import * as theia from '@theia/plugin';
|
|
32
|
-
import { AuthenticationSession, AuthenticationSessionsChangeEvent } from '../common/plugin-api-rpc-model';
|
|
31
|
+
import * as theia from '@theia/plugin/';
|
|
33
32
|
|
|
34
33
|
export class AuthenticationExtImpl implements AuthenticationExt {
|
|
35
34
|
private proxy: AuthenticationMain;
|
|
@@ -61,82 +60,88 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
61
60
|
return Object.freeze(this._providers.slice());
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: string[],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: readonly string[],
|
|
64
|
+
options: theia.AuthenticationGetSessionOptions & ({ createIfNone: true } | { forceNewSession: true } | { forceNewSession: { detail: string } })):
|
|
65
|
+
Promise<theia.AuthenticationSession>;
|
|
66
|
+
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: readonly string[],
|
|
67
|
+
options: theia.AuthenticationGetSessionOptions & { forceNewSession: true }): Promise<theia.AuthenticationSession>;
|
|
68
|
+
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: readonly string[],
|
|
69
|
+
options: theia.AuthenticationGetSessionOptions & { forceNewSession: { detail: string } }): Promise<theia.AuthenticationSession>;
|
|
70
|
+
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: readonly string[],
|
|
71
|
+
options: theia.AuthenticationGetSessionOptions): Promise<theia.AuthenticationSession | undefined>;
|
|
72
|
+
async getSession(requestingExtension: InternalPlugin, providerId: string, scopes: readonly string[],
|
|
73
|
+
options: theia.AuthenticationGetSessionOptions = {}): Promise<theia.AuthenticationSession | undefined> {
|
|
68
74
|
const extensionName = requestingExtension.model.displayName || requestingExtension.model.name;
|
|
69
75
|
const extensionId = requestingExtension.model.id.toLowerCase();
|
|
70
|
-
|
|
71
76
|
return this.proxy.$getSession(providerId, scopes, extensionId, extensionName, options);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
async logout(providerId: string, sessionId: string): Promise<void> {
|
|
75
|
-
return this.proxy.$
|
|
80
|
+
return this.proxy.$removeSession(providerId, sessionId);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
registerAuthenticationProvider(provider: theia.AuthenticationProvider): theia.Disposable {
|
|
79
|
-
if (this.authenticationProviders.get(
|
|
80
|
-
throw new Error(`An authentication provider with id '${
|
|
83
|
+
registerAuthenticationProvider(id: string, label: string, provider: theia.AuthenticationProvider, options?: theia.AuthenticationProviderOptions): theia.Disposable {
|
|
84
|
+
if (this.authenticationProviders.get(id)) {
|
|
85
|
+
throw new Error(`An authentication provider with id '${id}' is already registered.`);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
this.authenticationProviders.set(
|
|
84
|
-
if (this._providerIds.indexOf(
|
|
85
|
-
this._providerIds.push(
|
|
88
|
+
this.authenticationProviders.set(id, provider);
|
|
89
|
+
if (this._providerIds.indexOf(id) === -1) {
|
|
90
|
+
this._providerIds.push(id);
|
|
86
91
|
}
|
|
87
92
|
|
|
88
|
-
if (!this._providers.find(p => p.id ===
|
|
93
|
+
if (!this._providers.find(p => p.id === id)) {
|
|
89
94
|
this._providers.push({
|
|
90
|
-
id
|
|
91
|
-
label
|
|
95
|
+
id,
|
|
96
|
+
label
|
|
92
97
|
});
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
const listener = provider.onDidChangeSessions(e => {
|
|
96
|
-
this.proxy.$
|
|
101
|
+
this.proxy.$sendDidChangeSessions(id, e);
|
|
97
102
|
});
|
|
98
103
|
|
|
99
|
-
this.proxy.$registerAuthenticationProvider(
|
|
104
|
+
this.proxy.$registerAuthenticationProvider(id, label, !!options?.supportsMultipleAccounts);
|
|
100
105
|
|
|
101
106
|
return new Disposable(() => {
|
|
102
107
|
listener.dispose();
|
|
103
|
-
this.authenticationProviders.delete(
|
|
104
|
-
const index = this._providerIds.findIndex(
|
|
108
|
+
this.authenticationProviders.delete(id);
|
|
109
|
+
const index = this._providerIds.findIndex(pid => id === pid);
|
|
105
110
|
if (index > -1) {
|
|
106
111
|
this._providerIds.splice(index);
|
|
107
112
|
}
|
|
108
113
|
|
|
109
|
-
const i = this._providers.findIndex(p => p.id ===
|
|
114
|
+
const i = this._providers.findIndex(p => p.id === id);
|
|
110
115
|
if (i > -1) {
|
|
111
116
|
this._providers.splice(i);
|
|
112
117
|
}
|
|
113
118
|
|
|
114
|
-
this.proxy.$unregisterAuthenticationProvider(
|
|
119
|
+
this.proxy.$unregisterAuthenticationProvider(id);
|
|
115
120
|
});
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
$
|
|
123
|
+
$createSession(providerId: string, scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
119
124
|
const authProvider = this.authenticationProviders.get(providerId);
|
|
120
125
|
if (authProvider) {
|
|
121
|
-
return Promise.resolve(authProvider.
|
|
126
|
+
return Promise.resolve(authProvider.createSession(scopes));
|
|
122
127
|
}
|
|
123
128
|
|
|
124
129
|
throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
|
|
125
130
|
}
|
|
126
131
|
|
|
127
|
-
$
|
|
132
|
+
$removeSession(providerId: string, sessionId: string): Promise<void> {
|
|
128
133
|
const authProvider = this.authenticationProviders.get(providerId);
|
|
129
134
|
if (authProvider) {
|
|
130
|
-
return Promise.resolve(authProvider.
|
|
135
|
+
return Promise.resolve(authProvider.removeSession(sessionId));
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
|
|
134
139
|
}
|
|
135
140
|
|
|
136
|
-
async $getSessions(providerId: string): Promise<ReadonlyArray<AuthenticationSession>> {
|
|
141
|
+
async $getSessions(providerId: string, scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
137
142
|
const authProvider = this.authenticationProviders.get(providerId);
|
|
138
143
|
if (authProvider) {
|
|
139
|
-
const sessions = await authProvider.getSessions();
|
|
144
|
+
const sessions = await authProvider.getSessions(scopes);
|
|
140
145
|
|
|
141
146
|
/* Wrap the session object received from the plugin to prevent serialization mismatches
|
|
142
147
|
e.g. if the plugin object is constructed with the help of getters they won't be serialized:
|
|
@@ -158,12 +163,12 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
158
163
|
throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
$onDidChangeAuthenticationSessions(id: string, label: string
|
|
162
|
-
this.onDidChangeSessionsEmitter.fire({ provider: { id, label }
|
|
166
|
+
$onDidChangeAuthenticationSessions(id: string, label: string): Promise<void> {
|
|
167
|
+
this.onDidChangeSessionsEmitter.fire({ provider: { id, label } });
|
|
163
168
|
return Promise.resolve();
|
|
164
169
|
}
|
|
165
170
|
|
|
166
|
-
|
|
171
|
+
async $onDidChangeAuthenticationProviders(added: theia.AuthenticationProviderInformation[], removed: theia.AuthenticationProviderInformation[]): Promise<void> {
|
|
167
172
|
added.forEach(id => {
|
|
168
173
|
if (this._providers.indexOf(id) === -1) {
|
|
169
174
|
this._providers.push(id);
|
|
@@ -179,4 +184,9 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
179
184
|
|
|
180
185
|
this.onDidChangeAuthenticationProvidersEmitter.fire({ added, removed });
|
|
181
186
|
}
|
|
187
|
+
|
|
188
|
+
$setProviders(providers: theia.AuthenticationProviderInformation[]): Promise<void> {
|
|
189
|
+
this._providers.push(...providers);
|
|
190
|
+
return Promise.resolve(undefined);
|
|
191
|
+
}
|
|
182
192
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import * as theia from '@theia/plugin';
|
|
18
18
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
19
|
-
import { Selection } from '../../common/plugin-api-rpc';
|
|
19
|
+
import { Selection, WorkspaceEditDto } from '../../common/plugin-api-rpc';
|
|
20
20
|
import { Range, CodeActionContext, CodeAction } from '../../common/plugin-api-rpc-model';
|
|
21
21
|
import * as Converter from '../type-converters';
|
|
22
22
|
import { DocumentsExtImpl } from '../documents';
|
|
@@ -35,6 +35,11 @@ export class CodeActionAdapter {
|
|
|
35
35
|
private readonly commands: CommandRegistryImpl
|
|
36
36
|
) { }
|
|
37
37
|
|
|
38
|
+
private readonly cache = new Map<number, theia.CodeAction | theia.Command>();
|
|
39
|
+
private readonly disposables = new Map<number, DisposableCollection>();
|
|
40
|
+
|
|
41
|
+
private cacheId = 0;
|
|
42
|
+
|
|
38
43
|
async provideCodeAction(resource: URI, rangeOrSelection: Range | Selection,
|
|
39
44
|
context: CodeActionContext, token: theia.CancellationToken): Promise<CodeAction[] | undefined> {
|
|
40
45
|
const document = this.document.getDocumentData(resource);
|
|
@@ -64,15 +69,21 @@ export class CodeActionAdapter {
|
|
|
64
69
|
if (!Array.isArray(commandsOrActions) || commandsOrActions.length === 0) {
|
|
65
70
|
return undefined;
|
|
66
71
|
}
|
|
67
|
-
// TODO cache toDispose and dispose it
|
|
68
|
-
const toDispose = new DisposableCollection();
|
|
69
72
|
const result: CodeAction[] = [];
|
|
70
73
|
for (const candidate of commandsOrActions) {
|
|
71
74
|
if (!candidate) {
|
|
72
75
|
continue;
|
|
73
76
|
}
|
|
77
|
+
|
|
78
|
+
// Cache candidates and created commands.
|
|
79
|
+
const nextCacheId = this.nextCacheId();
|
|
80
|
+
const toDispose = new DisposableCollection();
|
|
81
|
+
this.cache.set(nextCacheId, candidate);
|
|
82
|
+
this.disposables.set(nextCacheId, toDispose);
|
|
83
|
+
|
|
74
84
|
if (CodeActionAdapter._isCommand(candidate)) {
|
|
75
85
|
result.push({
|
|
86
|
+
cacheId: nextCacheId,
|
|
76
87
|
title: candidate.title || '',
|
|
77
88
|
command: this.commands.converter.toSafeCommand(candidate, toDispose)
|
|
78
89
|
});
|
|
@@ -88,6 +99,7 @@ export class CodeActionAdapter {
|
|
|
88
99
|
}
|
|
89
100
|
|
|
90
101
|
result.push({
|
|
102
|
+
cacheId: nextCacheId,
|
|
91
103
|
title: candidate.title,
|
|
92
104
|
command: this.commands.converter.toSafeCommand(candidate.command, toDispose),
|
|
93
105
|
diagnostics: candidate.diagnostics && candidate.diagnostics.map(Converter.convertDiagnosticToMarkerData),
|
|
@@ -100,6 +112,37 @@ export class CodeActionAdapter {
|
|
|
100
112
|
return result;
|
|
101
113
|
}
|
|
102
114
|
|
|
115
|
+
async releaseCodeActions(cacheIds: number[]): Promise<void> {
|
|
116
|
+
cacheIds.forEach(id => {
|
|
117
|
+
this.cache.delete(id);
|
|
118
|
+
const toDispose = this.disposables.get(id);
|
|
119
|
+
if (toDispose) {
|
|
120
|
+
toDispose.dispose();
|
|
121
|
+
this.disposables.delete(id);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async resolveCodeAction(cacheId: number, token: theia.CancellationToken): Promise<WorkspaceEditDto | undefined> {
|
|
127
|
+
if (!this.provider.resolveCodeAction) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Code actions are only resolved if they are not legacy commands and don't have an edit property
|
|
132
|
+
// https://code.visualstudio.com/api/references/vscode-api#CodeActionProvider
|
|
133
|
+
const candidate = this.cache.get(cacheId);
|
|
134
|
+
if (!candidate || CodeActionAdapter._isCommand(candidate) || candidate.edit) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const resolved = await this.provider.resolveCodeAction(candidate, token);
|
|
139
|
+
return resolved?.edit && Converter.fromWorkspaceEdit(resolved.edit);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private nextCacheId(): number {
|
|
143
|
+
return this.cacheId++;
|
|
144
|
+
}
|
|
145
|
+
|
|
103
146
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
147
|
private static _isCommand(smth: any): smth is theia.Command {
|
|
105
148
|
return typeof (<theia.Command>smth).command === 'string';
|
package/src/plugin/languages.ts
CHANGED
|
@@ -463,6 +463,15 @@ export class LanguagesExtImpl implements LanguagesExt {
|
|
|
463
463
|
): Promise<CodeAction[] | undefined> {
|
|
464
464
|
return this.withAdapter(handle, CodeActionAdapter, adapter => adapter.provideCodeAction(URI.revive(resource), rangeOrSelection, context, token), undefined);
|
|
465
465
|
}
|
|
466
|
+
|
|
467
|
+
$releaseCodeActions(handle: number, cacheIds: number[]): void {
|
|
468
|
+
this.withAdapter(handle, CodeActionAdapter, adapter => adapter.releaseCodeActions(cacheIds), undefined);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
$resolveCodeAction(handle: number, cacheId: number, token: theia.CancellationToken): Promise<WorkspaceEditDto | undefined> {
|
|
472
|
+
return this.withAdapter(handle, CodeActionAdapter, adapter => adapter.resolveCodeAction(cacheId, token), undefined);
|
|
473
|
+
};
|
|
474
|
+
|
|
466
475
|
// ### Code Actions Provider end
|
|
467
476
|
|
|
468
477
|
// ### Code Lens Provider begin
|
|
@@ -30,7 +30,7 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
|
30
30
|
readonly configuration: theia.DebugConfiguration;
|
|
31
31
|
|
|
32
32
|
constructor(
|
|
33
|
-
readonly debugAdapter: DebugAdapter,
|
|
33
|
+
override readonly debugAdapter: DebugAdapter,
|
|
34
34
|
protected readonly tracker: theia.DebugAdapterTracker,
|
|
35
35
|
protected readonly theiaSession: theia.DebugSession) {
|
|
36
36
|
|
|
@@ -41,14 +41,14 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
|
41
41
|
this.configuration = theiaSession.configuration;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async start(channel: Channel): Promise<void> {
|
|
44
|
+
override async start(channel: Channel): Promise<void> {
|
|
45
45
|
if (this.tracker.onWillStartSession) {
|
|
46
46
|
this.tracker.onWillStartSession();
|
|
47
47
|
}
|
|
48
48
|
await super.start(channel);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
async stop(): Promise<void> {
|
|
51
|
+
override async stop(): Promise<void> {
|
|
52
52
|
if (this.tracker.onWillStopSession) {
|
|
53
53
|
this.tracker.onWillStopSession();
|
|
54
54
|
}
|
|
@@ -59,14 +59,14 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
|
59
59
|
return this.theiaSession.customRequest(command, args);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
protected onDebugAdapterError(error: Error): void {
|
|
62
|
+
protected override onDebugAdapterError(error: Error): void {
|
|
63
63
|
if (this.tracker.onError) {
|
|
64
64
|
this.tracker.onError(error);
|
|
65
65
|
}
|
|
66
66
|
super.onDebugAdapterError(error);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
protected send(message: string): void {
|
|
69
|
+
protected override send(message: string): void {
|
|
70
70
|
try {
|
|
71
71
|
super.send(message);
|
|
72
72
|
} finally {
|
|
@@ -76,14 +76,14 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
protected write(message: string): void {
|
|
79
|
+
protected override write(message: string): void {
|
|
80
80
|
if (this.tracker.onWillReceiveMessage) {
|
|
81
81
|
this.tracker.onWillReceiveMessage(JSON.parse(message));
|
|
82
82
|
}
|
|
83
83
|
super.write(message);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
protected onDebugAdapterExit(): void {
|
|
86
|
+
protected override onDebugAdapterExit(): void {
|
|
87
87
|
if (this.tracker.onExit) {
|
|
88
88
|
this.tracker.onExit(undefined, undefined);
|
|
89
89
|
}
|
|
@@ -18,7 +18,7 @@ import * as net from 'net';
|
|
|
18
18
|
import { ChildProcess, spawn, fork, ForkOptions } from 'child_process';
|
|
19
19
|
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
20
20
|
import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
|
|
21
|
-
import { InlineDebugAdapter } from '
|
|
21
|
+
import { InlineDebugAdapter } from './plugin-inline-debug-adapter';
|
|
22
22
|
import { ProcessDebugAdapter, SocketDebugAdapter } from '@theia/debug/lib/node/stream-debug-adapter';
|
|
23
23
|
const isElectron = require('is-electron');
|
|
24
24
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 Red Hat, Inc. 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 { Emitter, Event } from '@theia/core/lib/common/event';
|
|
18
|
+
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
19
|
+
import * as theia from '@theia/plugin';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A debug adapter for using the inline implementation from a plugin.
|
|
23
|
+
*/
|
|
24
|
+
export class InlineDebugAdapter implements DebugAdapter {
|
|
25
|
+
private messageReceivedEmitter = new Emitter<string>();
|
|
26
|
+
onMessageReceived: Event<string> = this.messageReceivedEmitter.event;
|
|
27
|
+
onError: Event<Error> = Event.None;
|
|
28
|
+
private closeEmitter = new Emitter<void>();
|
|
29
|
+
onClose: Event<void> = this.closeEmitter.event;
|
|
30
|
+
|
|
31
|
+
constructor(private debugAdapter: theia.DebugAdapter) {
|
|
32
|
+
this.debugAdapter.onDidSendMessage(msg => {
|
|
33
|
+
this.messageReceivedEmitter.fire(JSON.stringify(msg));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async start(): Promise<void> {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
send(message: string): void {
|
|
41
|
+
this.debugAdapter.handleMessage(JSON.parse(message));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async stop(): Promise<void> {
|
|
45
|
+
this.debugAdapter.dispose();
|
|
46
|
+
}
|
|
47
|
+
}
|