@theia/core 1.27.0-next.9 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -7
- package/i18n/nls.cs.json +52 -6
- package/i18n/nls.de.json +52 -6
- package/i18n/nls.es.json +52 -6
- package/i18n/nls.fr.json +52 -6
- package/i18n/nls.hu.json +55 -9
- package/i18n/nls.it.json +52 -6
- package/i18n/nls.ja.json +52 -6
- package/i18n/nls.json +52 -6
- package/i18n/nls.pl.json +52 -6
- package/i18n/nls.pt-br.json +52 -6
- package/i18n/nls.pt-pt.json +52 -6
- package/i18n/nls.ru.json +52 -6
- package/i18n/nls.zh-cn.json +52 -6
- package/lib/browser/color-application-contribution.d.ts +2 -2
- package/lib/browser/color-application-contribution.d.ts.map +1 -1
- package/lib/browser/color-application-contribution.js +15 -16
- package/lib/browser/color-application-contribution.js.map +1 -1
- package/lib/browser/color-registry.d.ts +0 -4
- package/lib/browser/color-registry.d.ts.map +1 -1
- package/lib/browser/color-registry.js +0 -14
- package/lib/browser/color-registry.js.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +4 -0
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +157 -163
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/common-styling-participants.d.ts +28 -0
- package/lib/browser/common-styling-participants.d.ts.map +1 -0
- package/lib/browser/common-styling-participants.js +319 -0
- package/lib/browser/common-styling-participants.js.map +1 -0
- package/lib/browser/connection-status-service.d.ts.map +1 -1
- package/lib/browser/connection-status-service.js +2 -2
- package/lib/browser/connection-status-service.js.map +1 -1
- package/lib/browser/connection-status-service.spec.js +1 -2
- package/lib/browser/connection-status-service.spec.js.map +1 -1
- package/lib/browser/context-menu-renderer.d.ts +1 -5
- package/lib/browser/context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/context-menu-renderer.js +10 -30
- package/lib/browser/context-menu-renderer.js.map +1 -1
- package/lib/browser/core-preferences.d.ts +1 -0
- package/lib/browser/core-preferences.d.ts.map +1 -1
- package/lib/browser/core-preferences.js +5 -0
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/decoration-style.d.ts +1 -0
- package/lib/browser/decoration-style.d.ts.map +1 -1
- package/lib/browser/decoration-style.js +6 -2
- package/lib/browser/decoration-style.js.map +1 -1
- package/lib/browser/frontend-application-bindings.d.ts.map +1 -1
- package/lib/browser/frontend-application-bindings.js +1 -3
- package/lib/browser/frontend-application-bindings.js.map +1 -1
- package/lib/browser/frontend-application-config-provider.d.ts +1 -0
- package/lib/browser/frontend-application-config-provider.d.ts.map +1 -1
- package/lib/browser/frontend-application-config-provider.js +2 -1
- package/lib/browser/frontend-application-config-provider.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +9 -3
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/i18n/i18n-frontend-module.d.ts.map +1 -1
- package/lib/browser/i18n/i18n-frontend-module.js +2 -0
- package/lib/browser/i18n/i18n-frontend-module.js.map +1 -1
- package/lib/browser/i18n/language-quick-pick-service.d.ts +17 -0
- package/lib/browser/i18n/language-quick-pick-service.d.ts.map +1 -0
- package/lib/browser/i18n/language-quick-pick-service.js +142 -0
- package/lib/browser/i18n/language-quick-pick-service.js.map +1 -0
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/keybinding.d.ts.map +1 -1
- package/lib/browser/keybinding.js +2 -1
- package/lib/browser/keybinding.js.map +1 -1
- package/lib/browser/keybinding.spec.js +18 -21
- package/lib/browser/keybinding.spec.js.map +1 -1
- package/lib/browser/label-provider.d.ts +0 -12
- package/lib/browser/label-provider.d.ts.map +1 -1
- package/lib/browser/label-provider.js +1 -13
- package/lib/browser/label-provider.js.map +1 -1
- package/lib/browser/logger-frontend-module.d.ts.map +1 -1
- package/lib/browser/logger-frontend-module.js +8 -1
- package/lib/browser/logger-frontend-module.js.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.d.ts +5 -4
- package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.js +30 -23
- package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
- package/lib/browser/preferences/preference-contribution.d.ts +2 -19
- package/lib/browser/preferences/preference-contribution.d.ts.map +1 -1
- package/lib/browser/preferences/preference-contribution.js +1 -24
- package/lib/browser/preferences/preference-contribution.js.map +1 -1
- package/lib/browser/preferences/preference-proxy.d.ts +0 -4
- package/lib/browser/preferences/preference-proxy.d.ts.map +1 -1
- package/lib/browser/preferences/preference-proxy.js.map +1 -1
- package/lib/browser/preferences/preference-proxy.spec.js +3 -102
- package/lib/browser/preferences/preference-proxy.spec.js.map +1 -1
- package/lib/browser/preferences/preference-schema-provider.spec.js +4 -3
- package/lib/browser/preferences/preference-schema-provider.spec.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +1 -2
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-validation-service.d.ts +2 -2
- package/lib/browser/preferences/preference-validation-service.d.ts.map +1 -1
- package/lib/browser/preferences/preference-validation-service.spec.js.map +1 -1
- package/lib/browser/preloader.d.ts.map +1 -1
- package/lib/browser/preloader.js +7 -1
- package/lib/browser/preloader.js.map +1 -1
- package/lib/browser/progress-status-bar-item.d.ts +1 -1
- package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +2 -2
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/saveable.d.ts.map +1 -1
- package/lib/browser/saveable.js +5 -4
- package/lib/browser/saveable.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts +4 -0
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +42 -36
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts +2 -0
- package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.js +5 -1
- package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
- package/lib/browser/shell/side-panel-handler.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-handler.js +3 -2
- package/lib/browser/shell/side-panel-handler.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +4 -2
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +12 -4
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/source-tree/source-tree-widget.js +1 -1
- package/lib/browser/source-tree/source-tree-widget.js.map +1 -1
- package/lib/browser/source-tree/tree-source.d.ts +2 -1
- package/lib/browser/source-tree/tree-source.d.ts.map +1 -1
- package/lib/browser/source-tree/tree-source.js.map +1 -1
- package/lib/browser/styling-service.d.ts +26 -0
- package/lib/browser/styling-service.d.ts.map +1 -0
- package/lib/browser/styling-service.js +76 -0
- package/lib/browser/styling-service.js.map +1 -0
- package/lib/browser/theming.d.ts +4 -8
- package/lib/browser/theming.d.ts.map +1 -1
- package/lib/browser/theming.js +38 -53
- package/lib/browser/theming.js.map +1 -1
- package/lib/browser/tree/search-box.d.ts.map +1 -1
- package/lib/browser/tree/search-box.js +5 -4
- package/lib/browser/tree/search-box.js.map +1 -1
- package/lib/browser/tree/test/tree-test-container.d.ts.map +1 -1
- package/lib/browser/tree/test/tree-test-container.js +2 -0
- package/lib/browser/tree/test/tree-test-container.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.js +4 -2
- package/lib/browser/tree/tree-compression/compressed-tree-model.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js +4 -2
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js.map +1 -1
- package/lib/browser/tree/tree-container.d.ts +2 -0
- package/lib/browser/tree/tree-container.d.ts.map +1 -1
- package/lib/browser/tree/tree-container.js +3 -0
- package/lib/browser/tree/tree-container.js.map +1 -1
- package/lib/browser/tree/tree-focus-service.d.ts +20 -0
- package/lib/browser/tree/tree-focus-service.d.ts.map +1 -0
- package/lib/browser/tree/tree-focus-service.js +62 -0
- package/lib/browser/tree/tree-focus-service.js.map +1 -0
- package/lib/browser/tree/tree-model.d.ts +11 -2
- package/lib/browser/tree/tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-model.js +29 -8
- package/lib/browser/tree/tree-model.js.map +1 -1
- package/lib/browser/tree/tree-selection-impl.d.ts +4 -1
- package/lib/browser/tree/tree-selection-impl.d.ts.map +1 -1
- package/lib/browser/tree/tree-selection-impl.js +13 -2
- package/lib/browser/tree/tree-selection-impl.js.map +1 -1
- package/lib/browser/tree/tree-selection-state.d.ts +1 -0
- package/lib/browser/tree/tree-selection-state.d.ts.map +1 -1
- package/lib/browser/tree/tree-selection-state.js +8 -2
- package/lib/browser/tree/tree-selection-state.js.map +1 -1
- package/lib/browser/tree/tree-selection.d.ts +9 -0
- package/lib/browser/tree/tree-selection.d.ts.map +1 -1
- package/lib/browser/tree/tree-selection.js +3 -0
- package/lib/browser/tree/tree-selection.js.map +1 -1
- package/lib/browser/tree/tree-widget-selection.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget-selection.js +9 -1
- package/lib/browser/tree/tree-widget-selection.js.map +1 -1
- package/lib/browser/tree/tree-widget.d.ts +14 -0
- package/lib/browser/tree/tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +80 -40
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser/tree/tree.d.ts +2 -1
- package/lib/browser/tree/tree.d.ts.map +1 -1
- package/lib/browser/tree/tree.js +12 -2
- package/lib/browser/tree/tree.js.map +1 -1
- package/lib/browser/view-container.d.ts +9 -4
- package/lib/browser/view-container.d.ts.map +1 -1
- package/lib/browser/view-container.js +36 -6
- package/lib/browser/view-container.js.map +1 -1
- package/lib/common/cancellation.d.ts +1 -0
- package/lib/common/cancellation.d.ts.map +1 -1
- package/lib/common/cancellation.js +8 -0
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/command.d.ts +1 -1
- package/lib/common/command.d.ts.map +1 -1
- package/lib/common/command.js +13 -16
- package/lib/common/command.js.map +1 -1
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/message-rpc/channel.d.ts +106 -0
- package/lib/common/message-rpc/channel.d.ts.map +1 -0
- package/lib/common/message-rpc/channel.js +195 -0
- package/lib/common/message-rpc/channel.js.map +1 -0
- package/lib/common/message-rpc/channel.spec.d.ts +9 -0
- package/lib/common/message-rpc/channel.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/channel.spec.js +80 -0
- package/lib/common/message-rpc/channel.spec.js.map +1 -0
- package/lib/common/message-rpc/index.d.ts +4 -0
- package/lib/common/message-rpc/index.d.ts.map +1 -0
- package/lib/{node/messaging/logger.js → common/message-rpc/index.js} +6 -19
- package/lib/common/message-rpc/index.js.map +1 -0
- package/lib/common/message-rpc/message-buffer.d.ts +50 -0
- package/lib/common/message-rpc/message-buffer.d.ts.map +1 -0
- package/lib/common/message-rpc/message-buffer.js +56 -0
- package/lib/common/message-rpc/message-buffer.js.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.d.ts +171 -0
- package/lib/common/message-rpc/rpc-message-encoder.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.js +409 -0
- package/lib/common/message-rpc/rpc-message-encoder.js.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.d.ts +2 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.js +49 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.js.map +1 -0
- package/lib/common/message-rpc/rpc-protocol.d.ts +61 -0
- package/lib/common/message-rpc/rpc-protocol.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-protocol.js +183 -0
- package/lib/common/message-rpc/rpc-protocol.js.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.d.ts +52 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.d.ts.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.js +169 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.js.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.d.ts +2 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.js +39 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.js.map +1 -0
- package/lib/common/messaging/abstract-connection-provider.d.ts +9 -8
- package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
- package/lib/common/messaging/abstract-connection-provider.js +20 -35
- package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
- package/lib/common/messaging/connection-error-handler.d.ts +1 -2
- package/lib/common/messaging/connection-error-handler.d.ts.map +1 -1
- package/lib/common/messaging/connection-error-handler.js +1 -1
- package/lib/common/messaging/connection-error-handler.js.map +1 -1
- package/lib/common/messaging/handler.d.ts +2 -2
- package/lib/common/messaging/handler.d.ts.map +1 -1
- package/lib/common/messaging/proxy-factory.d.ts +13 -7
- package/lib/common/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/common/messaging/proxy-factory.js +18 -13
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/messaging/proxy-factory.spec.js +4 -15
- package/lib/common/messaging/proxy-factory.spec.js.map +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts +54 -48
- package/lib/common/messaging/web-socket-channel.d.ts.map +1 -1
- package/lib/common/messaging/web-socket-channel.js +41 -105
- package/lib/common/messaging/web-socket-channel.js.map +1 -1
- package/lib/common/nls.d.ts +2 -0
- package/lib/common/nls.d.ts.map +1 -1
- package/lib/common/nls.js +11 -0
- package/lib/common/nls.js.map +1 -1
- package/lib/common/preferences/preference-schema.d.ts +1 -5
- package/lib/common/preferences/preference-schema.d.ts.map +1 -1
- package/lib/common/preferences/preference-schema.js.map +1 -1
- package/lib/common/promise-util.d.ts +2 -1
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js +8 -13
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/resource.d.ts +5 -0
- package/lib/common/resource.d.ts.map +1 -1
- package/lib/common/resource.js +28 -1
- package/lib/common/resource.js.map +1 -1
- package/lib/common/theme.d.ts +3 -2
- package/lib/common/theme.d.ts.map +1 -1
- package/lib/common/theme.js +5 -0
- package/lib/common/theme.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts +2 -2
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js +18 -7
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts +2 -2
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.js +5 -7
- package/lib/electron-browser/messaging/electron-ws-connection-provider.js.map +1 -1
- package/lib/electron-main/event-utils.d.ts +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +37 -9
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.js +83 -68
- package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-service.d.ts +2 -8
- package/lib/electron-main/messaging/electron-messaging-service.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-service.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.d.ts +45 -0
- package/lib/node/messaging/binary-message-pipe.d.ts.map +1 -0
- package/lib/node/messaging/binary-message-pipe.js +152 -0
- package/lib/node/messaging/binary-message-pipe.js.map +1 -0
- package/lib/node/messaging/ipc-bootstrap.js +2 -11
- package/lib/node/messaging/ipc-bootstrap.js.map +1 -1
- package/lib/node/messaging/ipc-channel.d.ts +26 -0
- package/lib/node/messaging/ipc-channel.d.ts.map +1 -0
- package/lib/node/messaging/ipc-channel.js +86 -0
- package/lib/node/messaging/ipc-channel.js.map +1 -0
- package/lib/node/messaging/ipc-connection-provider.d.ts +3 -5
- package/lib/node/messaging/ipc-connection-provider.d.ts.map +1 -1
- package/lib/node/messaging/ipc-connection-provider.js +14 -31
- package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
- package/lib/node/messaging/ipc-protocol.d.ts +2 -2
- package/lib/node/messaging/ipc-protocol.d.ts.map +1 -1
- package/lib/node/messaging/messaging-contribution.d.ts +6 -9
- package/lib/node/messaging/messaging-contribution.d.ts.map +1 -1
- package/lib/node/messaging/messaging-contribution.js +23 -68
- package/lib/node/messaging/messaging-contribution.js.map +1 -1
- package/lib/node/messaging/messaging-service.d.ts +4 -23
- package/lib/node/messaging/messaging-service.d.ts.map +1 -1
- package/lib/node/messaging/messaging-service.js +1 -15
- package/lib/node/messaging/messaging-service.js.map +1 -1
- package/lib/node/messaging/test/test-web-socket-channel.d.ts +4 -2
- package/lib/node/messaging/test/test-web-socket-channel.d.ts.map +1 -1
- package/lib/node/messaging/test/test-web-socket-channel.js +25 -12
- package/lib/node/messaging/test/test-web-socket-channel.js.map +1 -1
- package/lib/node/request/proxy-cli-contribution.js +1 -1
- package/lib/node/request/proxy-cli-contribution.js.map +1 -1
- package/package.json +7 -10
- package/src/browser/color-application-contribution.ts +10 -17
- package/src/browser/color-registry.ts +0 -5
- package/src/browser/common-frontend-contribution.ts +26 -33
- package/src/browser/common-styling-participants.ts +307 -0
- package/src/browser/connection-status-service.spec.ts +1 -4
- package/src/browser/connection-status-service.ts +3 -3
- package/src/browser/context-menu-renderer.ts +13 -29
- package/src/browser/core-preferences.ts +6 -0
- package/src/browser/decoration-style.ts +6 -2
- package/src/browser/frontend-application-bindings.ts +1 -3
- package/src/browser/frontend-application-config-provider.ts +2 -0
- package/src/browser/frontend-application-module.ts +11 -4
- package/src/browser/i18n/i18n-frontend-module.ts +2 -0
- package/src/browser/i18n/language-quick-pick-service.ts +128 -0
- package/src/browser/index.ts +1 -0
- package/src/browser/keybinding.spec.ts +22 -27
- package/src/browser/keybinding.ts +2 -1
- package/src/browser/label-provider.ts +0 -13
- package/src/browser/logger-frontend-module.ts +8 -1
- package/src/browser/messaging/ws-connection-provider.ts +34 -25
- package/src/browser/preferences/preference-contribution.ts +3 -28
- package/src/browser/preferences/preference-proxy.spec.ts +3 -113
- package/src/browser/preferences/preference-proxy.ts +0 -4
- package/src/browser/preferences/preference-schema-provider.spec.ts +1 -4
- package/src/browser/preferences/preference-service.spec.ts +1 -5
- package/src/browser/preferences/preference-validation-service.spec.ts +2 -2
- package/src/browser/preferences/preference-validation-service.ts +2 -2
- package/src/browser/preloader.ts +9 -2
- package/src/browser/progress-status-bar-item.ts +1 -1
- package/src/browser/quick-input/quick-command-service.ts +3 -3
- package/src/browser/saveable.ts +5 -4
- package/src/browser/shell/application-shell.ts +42 -35
- package/src/browser/shell/shell-layout-restorer.ts +4 -6
- package/src/browser/shell/side-panel-handler.ts +3 -2
- package/src/browser/shell/tab-bars.ts +14 -4
- package/src/browser/source-tree/source-tree-widget.tsx +1 -1
- package/src/browser/source-tree/tree-source.ts +2 -1
- package/src/browser/style/breadcrumbs.css +0 -1
- package/src/browser/style/index.css +66 -29
- package/src/browser/style/menus.css +4 -2
- package/src/browser/style/select-component.css +2 -0
- package/src/browser/style/sidepanel.css +11 -25
- package/src/browser/style/status-bar.css +8 -17
- package/src/browser/style/tabs.css +0 -16
- package/src/browser/style/tooltip.css +3 -3
- package/src/browser/style/tree.css +27 -11
- package/src/browser/style/view-container.css +4 -0
- package/src/browser/styling-service.ts +76 -0
- package/src/browser/theming.ts +18 -45
- package/src/browser/tree/search-box.ts +5 -4
- package/src/browser/tree/test/tree-test-container.ts +2 -0
- package/src/browser/tree/tree-compression/compressed-tree-model.ts +8 -2
- package/src/browser/tree/tree-compression/compressed-tree-widget.tsx +4 -2
- package/src/browser/tree/tree-container.ts +4 -0
- package/src/browser/tree/tree-focus-service.ts +55 -0
- package/src/browser/tree/tree-model.ts +32 -8
- package/src/browser/tree/tree-selection-impl.ts +13 -4
- package/src/browser/tree/tree-selection-state.ts +7 -2
- package/src/browser/tree/tree-selection.ts +10 -0
- package/src/browser/tree/tree-widget-selection.ts +10 -1
- package/src/browser/tree/tree-widget.tsx +83 -43
- package/src/browser/tree/tree.ts +8 -2
- package/src/browser/view-container.ts +41 -4
- package/src/common/cancellation.ts +8 -0
- package/src/common/command.ts +14 -16
- package/src/common/index.ts +1 -0
- package/src/common/message-rpc/channel.spec.ts +88 -0
- package/src/common/message-rpc/channel.ts +260 -0
- package/src/{node/messaging/logger.ts → common/message-rpc/index.ts} +4 -23
- package/src/common/message-rpc/message-buffer.ts +99 -0
- package/src/common/message-rpc/rpc-message-encoder.spec.ts +55 -0
- package/src/common/message-rpc/rpc-message-encoder.ts +552 -0
- package/src/common/message-rpc/rpc-protocol.ts +217 -0
- package/src/common/message-rpc/uint8-array-message-buffer.spec.ts +41 -0
- package/src/common/message-rpc/uint8-array-message-buffer.ts +206 -0
- package/src/common/messaging/abstract-connection-provider.ts +28 -37
- package/src/common/messaging/connection-error-handler.ts +1 -2
- package/src/common/messaging/handler.ts +2 -2
- package/src/common/messaging/proxy-factory.spec.ts +4 -17
- package/src/common/messaging/proxy-factory.ts +27 -16
- package/src/common/messaging/web-socket-channel.ts +79 -135
- package/src/common/nls.ts +11 -0
- package/src/common/preferences/preference-schema.ts +1 -6
- package/src/common/promise-util.ts +13 -14
- package/src/common/resource.ts +29 -2
- package/src/common/theme.ts +6 -2
- package/src/electron-browser/messaging/electron-ipc-connection-provider.ts +21 -7
- package/src/electron-browser/messaging/electron-ws-connection-provider.ts +5 -8
- package/src/electron-main/messaging/electron-messaging-contribution.ts +87 -65
- package/src/electron-main/messaging/electron-messaging-service.ts +2 -8
- package/src/node/messaging/binary-message-pipe.ts +168 -0
- package/src/node/messaging/ipc-bootstrap.ts +3 -11
- package/src/node/messaging/ipc-channel.ts +97 -0
- package/src/node/messaging/ipc-connection-provider.ts +18 -35
- package/src/node/messaging/ipc-protocol.ts +2 -2
- package/src/node/messaging/messaging-contribution.ts +29 -74
- package/src/node/messaging/messaging-service.ts +4 -31
- package/src/node/messaging/test/test-web-socket-channel.ts +26 -17
- package/src/node/request/proxy-cli-contribution.ts +1 -1
- package/lib/browser/preferences/validated-preference-proxy.d.ts +0 -21
- package/lib/browser/preferences/validated-preference-proxy.d.ts.map +0 -1
- package/lib/browser/preferences/validated-preference-proxy.js +0 -118
- package/lib/browser/preferences/validated-preference-proxy.js.map +0 -1
- package/lib/node/messaging/logger.d.ts +0 -8
- package/lib/node/messaging/logger.d.ts.map +0 -1
- package/lib/node/messaging/logger.js.map +0 -1
- package/shared/vscode-ws-jsonrpc/index.d.ts +0 -1
- package/shared/vscode-ws-jsonrpc/index.js +0 -1
- package/src/browser/preferences/validated-preference-proxy.ts +0 -111
- package/src/browser/style/variables-bright.useable.css +0 -93
- package/src/browser/style/variables-dark.useable.css +0 -93
|
@@ -23,9 +23,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.AbstractConnectionProvider = void 0;
|
|
25
25
|
const inversify_1 = require("inversify");
|
|
26
|
-
const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
|
|
27
26
|
const event_1 = require("../event");
|
|
28
27
|
const proxy_factory_1 = require("./proxy-factory");
|
|
28
|
+
const channel_1 = require("../message-rpc/channel");
|
|
29
29
|
/**
|
|
30
30
|
* Factor common logic according to `ElectronIpcConnectionProvider` and
|
|
31
31
|
* `WebSocketConnectionProvider`. This class handles channels in a somewhat
|
|
@@ -33,9 +33,10 @@ const proxy_factory_1 = require("./proxy-factory");
|
|
|
33
33
|
*/
|
|
34
34
|
let AbstractConnectionProvider = class AbstractConnectionProvider {
|
|
35
35
|
constructor() {
|
|
36
|
-
this.channelIdSeq = 0;
|
|
37
|
-
this.channels = new Map();
|
|
38
36
|
this.onIncomingMessageActivityEmitter = new event_1.Emitter();
|
|
37
|
+
// A set of channel opening functions that are executed if the backend reconnects to restore the
|
|
38
|
+
// the channels that were open before the disconnect occurred.
|
|
39
|
+
this.reconnectChannelOpeners = [];
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Create a proxy object to remote interface of T type
|
|
@@ -58,47 +59,31 @@ let AbstractConnectionProvider = class AbstractConnectionProvider {
|
|
|
58
59
|
});
|
|
59
60
|
return factory.createProxy();
|
|
60
61
|
}
|
|
62
|
+
initializeMultiplexer() {
|
|
63
|
+
const mainChannel = this.createMainChannel();
|
|
64
|
+
mainChannel.onMessage(() => this.onIncomingMessageActivityEmitter.fire());
|
|
65
|
+
this.channelMultiPlexer = new channel_1.ChannelMultiplexer(mainChannel);
|
|
66
|
+
}
|
|
61
67
|
/**
|
|
62
68
|
* Install a connection handler for the given path.
|
|
63
69
|
*/
|
|
64
70
|
listen(handler, options) {
|
|
65
71
|
this.openChannel(handler.path, channel => {
|
|
66
|
-
|
|
67
|
-
connection.onDispose(() => channel.close());
|
|
68
|
-
handler.onConnection(connection);
|
|
72
|
+
handler.onConnection(channel);
|
|
69
73
|
}, options);
|
|
70
74
|
}
|
|
71
|
-
openChannel(path, handler, options) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
console.error('The ws channel does not exist', channel.id);
|
|
75
|
+
async openChannel(path, handler, options) {
|
|
76
|
+
if (!this.channelMultiPlexer) {
|
|
77
|
+
throw new Error('The channel multiplexer has not been initialized yet!');
|
|
78
|
+
}
|
|
79
|
+
const newChannel = await this.channelMultiPlexer.open(path);
|
|
80
|
+
newChannel.onClose(() => {
|
|
81
|
+
const { reconnecting } = Object.assign({ reconnecting: true }, options);
|
|
82
|
+
if (reconnecting) {
|
|
83
|
+
this.reconnectChannelOpeners.push(() => this.openChannel(path, handler, options));
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
|
|
87
|
-
channel.open(path);
|
|
88
|
-
}
|
|
89
|
-
handleIncomingRawMessage(data) {
|
|
90
|
-
const message = JSON.parse(data);
|
|
91
|
-
const channel = this.channels.get(message.id);
|
|
92
|
-
if (channel) {
|
|
93
|
-
channel.handleMessage(message);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.error('The ws channel does not exist', message.id);
|
|
97
|
-
}
|
|
98
|
-
this.onIncomingMessageActivityEmitter.fire(undefined);
|
|
99
|
-
}
|
|
100
|
-
createLogger() {
|
|
101
|
-
return new vscode_ws_jsonrpc_1.ConsoleLogger();
|
|
86
|
+
handler(newChannel);
|
|
102
87
|
}
|
|
103
88
|
};
|
|
104
89
|
AbstractConnectionProvider = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-connection-provider.js","sourceRoot":"","sources":["../../../src/common/messaging/abstract-connection-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;AAEhF,yCAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"abstract-connection-provider.js","sourceRoot":"","sources":["../../../src/common/messaging/abstract-connection-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;AAEhF,yCAAmD;AACnD,oCAA0C;AAE1C,mDAAoE;AACpE,oDAAqE;AAErE;;;;GAIG;AAEH,IAAsB,0BAA0B,GAAhD,MAAsB,0BAA0B;IAAhD;QAkBuB,qCAAgC,GAAkB,IAAI,eAAO,EAAE,CAAC;QA6BnF,gGAAgG;QAChG,8DAA8D;QACpD,4BAAuB,GAA+B,EAAE,CAAC;IAqCvE,CAAC;IA/EG;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAmB,SAA+B,EAAE,IAAY,EAAE,MAAe;QAC/F,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAGD,IAAI,yBAAyB;QACzB,OAAO,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC;IACvD,CAAC;IAeD,WAAW,CAAmB,IAAY,EAAE,GAAY;QACpD,MAAM,OAAO,GAAG,GAAG,YAAY,mCAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,mCAAmB,CAAI,GAAG,CAAC,CAAC;QAC3F,IAAI,CAAC,MAAM,CAAC;YACR,IAAI;YACJ,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SACvC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAQS,qBAAqB;QAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,i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2
|
export interface ResolvedConnectionErrorHandlerOptions {
|
|
4
3
|
readonly serverName: string;
|
|
@@ -23,7 +22,7 @@ export declare type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionEr
|
|
|
23
22
|
export declare class ConnectionErrorHandler {
|
|
24
23
|
protected readonly options: ResolvedConnectionErrorHandlerOptions;
|
|
25
24
|
constructor(options: ConnectionErrorHandlerOptions);
|
|
26
|
-
shouldStop(error: Error,
|
|
25
|
+
shouldStop(error: Error, count?: number): boolean;
|
|
27
26
|
protected readonly restarts: number[];
|
|
28
27
|
shouldRestart(): boolean;
|
|
29
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"connection-error-handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,qCAAqC;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACnC;AAED,oBAAY,6BAA6B,GAAG,OAAO,CAAC,qCAAqC,CAAC,GAAG;IACzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAC3B,CAAC;AAEF,qBAAa,sBAAsB;IAE/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qCAAqC,CAAC;gBACtD,OAAO,EAAE,6BAA6B;IASlD,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAIjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAM;IAC3C,aAAa,IAAI,OAAO;CAe3B"}
|
|
@@ -21,7 +21,7 @@ class ConnectionErrorHandler {
|
|
|
21
21
|
this.restarts = [];
|
|
22
22
|
this.options = Object.assign({ maxErrors: 3, maxRestarts: 5, restartInterval: 3 }, options);
|
|
23
23
|
}
|
|
24
|
-
shouldStop(error,
|
|
24
|
+
shouldStop(error, count) {
|
|
25
25
|
return !count || count > this.options.maxErrors;
|
|
26
26
|
}
|
|
27
27
|
shouldRestart() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;
|
|
1
|
+
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AA0BhF,MAAa,sBAAsB;IAG/B,YAAY,OAAsC;QAa/B,aAAQ,GAAa,EAAE,CAAC;QAZvC,IAAI,CAAC,OAAO,mBACR,SAAS,EAAE,CAAC,EACZ,WAAW,EAAE,CAAC,EACd,eAAe,EAAE,CAAC,IACf,OAAO,CACb,CAAC;IACN,CAAC;IAED,UAAU,CAAC,KAAY,EAAE,KAAc;QACnC,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACpD,CAAC;IAGD,aAAa;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAClD,OAAO,IAAI,CAAC;SACf;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,EAAE,GAAG,IAAI,EAAE;YAClD,mCAAmC;YACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,mBAAmB,IAAI,CAAC,OAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC,OAAO,CAAC,eAAe,6CAA6C,CAAC,CAAC;YACpM,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AAhCD,wDAgCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Channel } from '../message-rpc/channel';
|
|
2
2
|
export declare const ConnectionHandler: unique symbol;
|
|
3
3
|
export interface ConnectionHandler {
|
|
4
4
|
readonly path: string;
|
|
5
|
-
onConnection(connection:
|
|
5
|
+
onConnection(connection: Channel): void;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MessageConnection } from 'vscode-ws-jsonrpc';
|
|
2
|
-
import { Event, Emitter } from '../event';
|
|
3
1
|
import { Disposable } from '../disposable';
|
|
2
|
+
import { Emitter, Event } from '../event';
|
|
3
|
+
import { Channel } from '../message-rpc/channel';
|
|
4
|
+
import { RequestHandler, RpcProtocol } from '../message-rpc/rpc-protocol';
|
|
4
5
|
import { ConnectionHandler } from './handler';
|
|
5
6
|
export declare type JsonRpcServer<Client> = Disposable & {
|
|
6
7
|
/**
|
|
@@ -21,8 +22,12 @@ export declare class JsonRpcConnectionHandler<T extends object> implements Conne
|
|
|
21
22
|
readonly targetFactory: (proxy: JsonRpcProxy<T>) => any;
|
|
22
23
|
readonly factoryConstructor: new () => JsonRpcProxyFactory<T>;
|
|
23
24
|
constructor(path: string, targetFactory: (proxy: JsonRpcProxy<T>) => any, factoryConstructor?: new () => JsonRpcProxyFactory<T>);
|
|
24
|
-
onConnection(connection:
|
|
25
|
+
onConnection(connection: Channel): void;
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Factory for creating a new {@link RpcConnection} for a given chanel and {@link RequestHandler}.
|
|
29
|
+
*/
|
|
30
|
+
export declare type RpcConnectionFactory = (channel: Channel, requestHandler: RequestHandler) => RpcProtocol;
|
|
26
31
|
/**
|
|
27
32
|
* Factory for JSON-RPC proxy objects.
|
|
28
33
|
*
|
|
@@ -67,17 +72,18 @@ export declare class JsonRpcConnectionHandler<T extends object> implements Conne
|
|
|
67
72
|
*/
|
|
68
73
|
export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandler<T> {
|
|
69
74
|
target?: any;
|
|
75
|
+
protected rpcConnectionFactory: RpcConnectionFactory;
|
|
70
76
|
protected readonly onDidOpenConnectionEmitter: Emitter<void>;
|
|
71
77
|
protected readonly onDidCloseConnectionEmitter: Emitter<void>;
|
|
72
|
-
protected connectionPromiseResolve: (connection:
|
|
73
|
-
protected connectionPromise: Promise<
|
|
78
|
+
protected connectionPromiseResolve: (connection: RpcProtocol) => void;
|
|
79
|
+
protected connectionPromise: Promise<RpcProtocol>;
|
|
74
80
|
/**
|
|
75
81
|
* Build a new JsonRpcProxyFactory.
|
|
76
82
|
*
|
|
77
83
|
* @param target - The object to expose to JSON-RPC methods calls. If this
|
|
78
84
|
* is omitted, the proxy won't be able to handle requests, only send them.
|
|
79
85
|
*/
|
|
80
|
-
constructor(target?: any);
|
|
86
|
+
constructor(target?: any, rpcConnectionFactory?: RpcConnectionFactory);
|
|
81
87
|
protected waitForConnection(): void;
|
|
82
88
|
/**
|
|
83
89
|
* Connect a MessageConnection to the factory.
|
|
@@ -85,7 +91,7 @@ export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandl
|
|
|
85
91
|
* This connection will be used to send/receive JSON-RPC requests and
|
|
86
92
|
* response.
|
|
87
93
|
*/
|
|
88
|
-
listen(
|
|
94
|
+
listen(channel: Channel): void;
|
|
89
95
|
/**
|
|
90
96
|
* Process an incoming JSON-RPC method call.
|
|
91
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy-factory.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,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG;IAQrC,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG;CAgBhE"}
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.JsonRpcProxyFactory = exports.JsonRpcConnectionHandler = void 0;
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
|
-
const
|
|
20
|
+
const rpc_message_encoder_1 = require("../message-rpc/rpc-message-encoder");
|
|
21
21
|
const application_error_1 = require("../application-error");
|
|
22
22
|
const event_1 = require("../event");
|
|
23
|
+
const rpc_protocol_1 = require("../message-rpc/rpc-protocol");
|
|
23
24
|
class JsonRpcConnectionHandler {
|
|
24
25
|
constructor(path, targetFactory, factoryConstructor = JsonRpcProxyFactory) {
|
|
25
26
|
this.path = path;
|
|
@@ -34,6 +35,7 @@ class JsonRpcConnectionHandler {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
|
|
38
|
+
const defaultRPCConnectionFactory = (channel, requestHandler) => new rpc_protocol_1.RpcProtocol(channel, requestHandler);
|
|
37
39
|
/**
|
|
38
40
|
* Factory for JSON-RPC proxy objects.
|
|
39
41
|
*
|
|
@@ -83,8 +85,9 @@ class JsonRpcProxyFactory {
|
|
|
83
85
|
* @param target - The object to expose to JSON-RPC methods calls. If this
|
|
84
86
|
* is omitted, the proxy won't be able to handle requests, only send them.
|
|
85
87
|
*/
|
|
86
|
-
constructor(target) {
|
|
88
|
+
constructor(target, rpcConnectionFactory = defaultRPCConnectionFactory) {
|
|
87
89
|
this.target = target;
|
|
90
|
+
this.rpcConnectionFactory = rpcConnectionFactory;
|
|
88
91
|
this.onDidOpenConnectionEmitter = new event_1.Emitter();
|
|
89
92
|
this.onDidCloseConnectionEmitter = new event_1.Emitter();
|
|
90
93
|
this.waitForConnection();
|
|
@@ -92,7 +95,11 @@ class JsonRpcProxyFactory {
|
|
|
92
95
|
waitForConnection() {
|
|
93
96
|
this.connectionPromise = new Promise(resolve => this.connectionPromiseResolve = resolve);
|
|
94
97
|
this.connectionPromise.then(connection => {
|
|
95
|
-
connection.onClose(() =>
|
|
98
|
+
connection.channel.onClose(() => {
|
|
99
|
+
this.onDidCloseConnectionEmitter.fire(undefined);
|
|
100
|
+
// Wait for connection in case the backend reconnects
|
|
101
|
+
this.waitForConnection();
|
|
102
|
+
});
|
|
96
103
|
this.onDidOpenConnectionEmitter.fire(undefined);
|
|
97
104
|
});
|
|
98
105
|
}
|
|
@@ -102,11 +109,9 @@ class JsonRpcProxyFactory {
|
|
|
102
109
|
* This connection will be used to send/receive JSON-RPC requests and
|
|
103
110
|
* response.
|
|
104
111
|
*/
|
|
105
|
-
listen(
|
|
106
|
-
connection.
|
|
107
|
-
connection.onNotification(
|
|
108
|
-
connection.onDispose(() => this.waitForConnection());
|
|
109
|
-
connection.listen();
|
|
112
|
+
listen(channel) {
|
|
113
|
+
const connection = this.rpcConnectionFactory(channel, (meth, args) => this.onRequest(meth, ...args));
|
|
114
|
+
connection.onNotification(event => this.onNotification(event.method, ...event.args));
|
|
110
115
|
this.connectionPromiseResolve(connection);
|
|
111
116
|
}
|
|
112
117
|
/**
|
|
@@ -132,7 +137,7 @@ class JsonRpcProxyFactory {
|
|
|
132
137
|
}
|
|
133
138
|
catch (error) {
|
|
134
139
|
const e = this.serializeError(error);
|
|
135
|
-
if (e instanceof
|
|
140
|
+
if (e instanceof rpc_message_encoder_1.ResponseError) {
|
|
136
141
|
throw e;
|
|
137
142
|
}
|
|
138
143
|
const reason = e.message || '';
|
|
@@ -207,11 +212,11 @@ class JsonRpcProxyFactory {
|
|
|
207
212
|
return this.connectionPromise.then(connection => new Promise((resolve, reject) => {
|
|
208
213
|
try {
|
|
209
214
|
if (isNotify) {
|
|
210
|
-
connection.sendNotification(method,
|
|
215
|
+
connection.sendNotification(method, args);
|
|
211
216
|
resolve(undefined);
|
|
212
217
|
}
|
|
213
218
|
else {
|
|
214
|
-
const resultPromise = connection.sendRequest(method,
|
|
219
|
+
const resultPromise = connection.sendRequest(method, args);
|
|
215
220
|
resultPromise
|
|
216
221
|
.catch((err) => reject(this.deserializeError(capturedError, err)))
|
|
217
222
|
.then((result) => resolve(result));
|
|
@@ -237,12 +242,12 @@ class JsonRpcProxyFactory {
|
|
|
237
242
|
}
|
|
238
243
|
serializeError(e) {
|
|
239
244
|
if (application_error_1.ApplicationError.is(e)) {
|
|
240
|
-
return new
|
|
245
|
+
return new rpc_message_encoder_1.ResponseError(e.code, '', Object.assign({ kind: 'application' }, e.toJson()));
|
|
241
246
|
}
|
|
242
247
|
return e;
|
|
243
248
|
}
|
|
244
249
|
deserializeError(capturedError, e) {
|
|
245
|
-
if (e instanceof
|
|
250
|
+
if (e instanceof rpc_message_encoder_1.ResponseError) {
|
|
246
251
|
const capturedStack = capturedError.stack || '';
|
|
247
252
|
if (e.data && e.data.kind === 'application') {
|
|
248
253
|
const { stack, data, message } = e.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,uDAAuD;AAEvD,
|
|
1
|
+
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;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EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CACrD,CAAC;SACL;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IACS,gBAAgB,CAAC,aAAoB,EAAE,CAAM;QACnD,IAAI,CAAC,YAAY,mCAAa,EAAE;YAC5B,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC;YAChD,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;gBACzC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC;gBACxC,OAAO,oCAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE;oBACrC,OAAO,EAAE,OAAO,IAAI,aAAa,CAAC,OAAO;oBACzC,IAAI;oBACJ,KAAK,EAAE,GAAG,aAAa,gBAAgB,KAAK,EAAE;iBACjD,CAAC,CAAC;aACN;YACD,CAAC,CAAC,KAAK,GAAG,aAAa,CAAC;SAC3B;QACD,OAAO,CAAC,CAAC;IACb,CAAC;CAEJ;AAtMD,kDAsMC"}
|
|
@@ -16,17 +16,9 @@
|
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const chai = require("chai");
|
|
19
|
-
const logger_1 = require("../../node/messaging/logger");
|
|
20
19
|
const proxy_factory_1 = require("./proxy-factory");
|
|
21
|
-
const
|
|
22
|
-
const stream = require("stream");
|
|
20
|
+
const channel_spec_1 = require("../message-rpc/channel.spec");
|
|
23
21
|
const expect = chai.expect;
|
|
24
|
-
class NoTransform extends stream.Transform {
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
_transform(chunk, encoding, callback) {
|
|
27
|
-
callback(undefined, chunk);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
22
|
class TestServer {
|
|
31
23
|
constructor() {
|
|
32
24
|
this.requests = [];
|
|
@@ -92,14 +84,11 @@ function getSetup() {
|
|
|
92
84
|
const client = new TestClient();
|
|
93
85
|
const server = new TestServer();
|
|
94
86
|
const serverProxyFactory = new proxy_factory_1.JsonRpcProxyFactory(client);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const serverConnection = (0, main_1.createMessageConnection)(server2client, client2server, new logger_1.ConsoleLogger());
|
|
98
|
-
serverProxyFactory.listen(serverConnection);
|
|
87
|
+
const pipe = new channel_spec_1.ChannelPipe();
|
|
88
|
+
serverProxyFactory.listen(pipe.right);
|
|
99
89
|
const serverProxy = serverProxyFactory.createProxy();
|
|
100
90
|
const clientProxyFactory = new proxy_factory_1.JsonRpcProxyFactory(server);
|
|
101
|
-
|
|
102
|
-
clientProxyFactory.listen(clientConnection);
|
|
91
|
+
clientProxyFactory.listen(pipe.left);
|
|
103
92
|
const clientProxy = clientProxyFactory.createProxy();
|
|
104
93
|
return {
|
|
105
94
|
client,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.spec.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;AAEhF,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"proxy-factory.spec.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACv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YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,SAAS,QAAQ;IAMb,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEhC,MAAM,kBAAkB,GAAG,IAAI,mCAAmB,CAAa,MAAM,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC/B,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;IAErD,MAAM,kBAAkB,GAAG,IAAI,mCAAmB,CAAa,MAAM,CAAC,CAAC;IACvE,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO;QACH,MAAM;QACN,WAAW;QACX,MAAM;QACN,WAAW;KACd,CAAC;AACN,CAAC"}
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Emitter, Event } from '../event';
|
|
2
|
+
import { WriteBuffer } from '../message-rpc';
|
|
3
|
+
import { Channel, MessageProvider, ChannelCloseEvent } from '../message-rpc/channel';
|
|
4
|
+
import { DisposableCollection } from '../disposable';
|
|
5
|
+
/**
|
|
6
|
+
* A channel that manages the main websocket connection between frontend and backend. All service channels
|
|
7
|
+
* are reusing this main channel. (multiplexing). An {@link IWebSocket} abstraction is used to keep the implementation
|
|
8
|
+
* independent of the actual websocket implementation and its execution context (backend vs. frontend).
|
|
9
|
+
*/
|
|
10
|
+
export declare class WebSocketChannel implements Channel {
|
|
11
|
+
protected readonly socket: IWebSocket;
|
|
7
12
|
static wsPath: string;
|
|
8
|
-
protected readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
protected
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
close(
|
|
18
|
-
tryClose(code?: number, reason?: string): void;
|
|
19
|
-
protected fireOpen: () => void;
|
|
20
|
-
onOpen(cb: () => void): void;
|
|
21
|
-
protected fireMessage: (data: any) => void;
|
|
22
|
-
onMessage(cb: (data: any) => void): void;
|
|
23
|
-
fireError: (reason: any) => void;
|
|
24
|
-
onError(cb: (reason: any) => void): void;
|
|
25
|
-
protected closing: boolean;
|
|
26
|
-
protected fireClose(code: number, reason: string): void;
|
|
27
|
-
onClose(cb: (code: number, reason: string) => void): Disposable;
|
|
13
|
+
protected readonly onCloseEmitter: Emitter<ChannelCloseEvent>;
|
|
14
|
+
get onClose(): Event<ChannelCloseEvent>;
|
|
15
|
+
protected readonly onMessageEmitter: Emitter<MessageProvider>;
|
|
16
|
+
get onMessage(): Event<MessageProvider>;
|
|
17
|
+
protected readonly onErrorEmitter: Emitter<unknown>;
|
|
18
|
+
get onError(): Event<unknown>;
|
|
19
|
+
protected toDispose: DisposableCollection;
|
|
20
|
+
constructor(socket: IWebSocket);
|
|
21
|
+
getWriteBuffer(): WriteBuffer;
|
|
22
|
+
close(): void;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
/**
|
|
25
|
+
* An abstraction that enables reuse of the `{@link WebSocketChannel} class in the frontend and backend
|
|
26
|
+
* independent of the actual underlying socket implementation.
|
|
27
|
+
*/
|
|
28
|
+
export interface IWebSocket {
|
|
29
|
+
/**
|
|
30
|
+
* Sends the given message over the web socket in binary format.
|
|
31
|
+
* @param message The binary message.
|
|
32
|
+
*/
|
|
33
|
+
send(message: Uint8Array): void;
|
|
34
|
+
/**
|
|
35
|
+
* Closes the websocket from the local side.
|
|
36
|
+
*/
|
|
37
|
+
close(): void;
|
|
38
|
+
/**
|
|
39
|
+
* The connection state of the web socket.
|
|
40
|
+
*/
|
|
41
|
+
isConnected(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Listener callback to handle incoming messages.
|
|
44
|
+
* @param cb The callback.
|
|
45
|
+
*/
|
|
46
|
+
onMessage(cb: (message: Uint8Array) => void): void;
|
|
47
|
+
/**
|
|
48
|
+
* Listener callback to handle socket errors.
|
|
49
|
+
* @param cb The callback.
|
|
50
|
+
*/
|
|
51
|
+
onError(cb: (reason: any) => void): void;
|
|
52
|
+
/**
|
|
53
|
+
* Listener callback to handle close events (Remote side).
|
|
54
|
+
* @param cb The callback.
|
|
55
|
+
*/
|
|
56
|
+
onClose(cb: (reason: string, code?: number) => void): void;
|
|
51
57
|
}
|
|
52
58
|
//# sourceMappingURL=web-socket-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-socket-channel.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"web-socket-channel.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,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