@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
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ReadBuffer, WriteBuffer } from './message-buffer';
|
|
2
|
+
/**
|
|
3
|
+
* This code lets you encode rpc protocol messages (request/reply/notification/error/cancel)
|
|
4
|
+
* into a channel write buffer and decode the same messages from a read buffer.
|
|
5
|
+
* Custom encoders/decoders can be registered to specially handling certain types of values
|
|
6
|
+
* to be encoded. Clients are responsible for ensuring that the set of tags for encoders
|
|
7
|
+
* is distinct and the same at both ends of a channel.
|
|
8
|
+
*/
|
|
9
|
+
export declare type RpcMessage = RequestMessage | ReplyMessage | ReplyErrMessage | CancelMessage | NotificationMessage;
|
|
10
|
+
export declare const enum RpcMessageType {
|
|
11
|
+
Request = 1,
|
|
12
|
+
Notification = 2,
|
|
13
|
+
Reply = 3,
|
|
14
|
+
ReplyErr = 4,
|
|
15
|
+
Cancel = 5
|
|
16
|
+
}
|
|
17
|
+
export interface CancelMessage {
|
|
18
|
+
type: RpcMessageType.Cancel;
|
|
19
|
+
id: number;
|
|
20
|
+
}
|
|
21
|
+
export interface RequestMessage {
|
|
22
|
+
type: RpcMessageType.Request;
|
|
23
|
+
id: number;
|
|
24
|
+
method: string;
|
|
25
|
+
args: any[];
|
|
26
|
+
}
|
|
27
|
+
export interface NotificationMessage {
|
|
28
|
+
type: RpcMessageType.Notification;
|
|
29
|
+
id: number;
|
|
30
|
+
method: string;
|
|
31
|
+
args: any[];
|
|
32
|
+
}
|
|
33
|
+
export interface ReplyMessage {
|
|
34
|
+
type: RpcMessageType.Reply;
|
|
35
|
+
id: number;
|
|
36
|
+
res: any;
|
|
37
|
+
}
|
|
38
|
+
export interface ReplyErrMessage {
|
|
39
|
+
type: RpcMessageType.ReplyErr;
|
|
40
|
+
id: number;
|
|
41
|
+
err: any;
|
|
42
|
+
}
|
|
43
|
+
export interface SerializedError {
|
|
44
|
+
readonly $isError: true;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly message: string;
|
|
47
|
+
readonly stack: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A special error that can be returned in case a request
|
|
51
|
+
* has failed. Provides additional information i.e. an error code
|
|
52
|
+
* and additional error data.
|
|
53
|
+
*/
|
|
54
|
+
export declare class ResponseError extends Error {
|
|
55
|
+
readonly code: number;
|
|
56
|
+
readonly data: any;
|
|
57
|
+
constructor(code: number, message: string, data: any);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The tag values for the default {@link ValueEncoder}s & {@link ValueDecoder}s
|
|
61
|
+
*/
|
|
62
|
+
export declare enum ObjectType {
|
|
63
|
+
JSON = 0,
|
|
64
|
+
ByteArray = 1,
|
|
65
|
+
ObjectArray = 2,
|
|
66
|
+
Undefined = 3,
|
|
67
|
+
Object = 4,
|
|
68
|
+
String = 5,
|
|
69
|
+
Boolean = 6,
|
|
70
|
+
Number = 7,
|
|
71
|
+
ResponseError = 8,
|
|
72
|
+
Error = 9,
|
|
73
|
+
Map = 10,
|
|
74
|
+
Set = 11,
|
|
75
|
+
Function = 12
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A value encoder writes javascript values to a write buffer. Encoders will be asked
|
|
79
|
+
* in turn (ordered by their tag value, descending) whether they can encode a given value
|
|
80
|
+
* This means encoders with higher tag values have priority. Since the default encoders
|
|
81
|
+
* have tag values from 1-12, they can be easily overridden.
|
|
82
|
+
*/
|
|
83
|
+
export interface ValueEncoder {
|
|
84
|
+
/**
|
|
85
|
+
* Returns true if this encoder wants to encode this value.
|
|
86
|
+
* @param value the value to be encoded
|
|
87
|
+
*/
|
|
88
|
+
is(value: any): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Write the given value to the buffer. Will only be called if {@link is(value)} returns true.
|
|
91
|
+
* @param buf The buffer to write to
|
|
92
|
+
* @param value The value to be written
|
|
93
|
+
* @param visitedObjects The collection of already visited (i.e. encoded) objects. Used to detect circular references
|
|
94
|
+
* @param recursiveEncode A function that will use the encoders registered on the {@link MessageEncoder}
|
|
95
|
+
* to write a value to the underlying buffer. This is used mostly to write structures like an array
|
|
96
|
+
* without having to know how to encode the values in the array
|
|
97
|
+
*/
|
|
98
|
+
write(buf: WriteBuffer, value: any, visitedObjects: WeakSet<object>, recursiveEncode?: (buf: WriteBuffer, value: any, visitedObjects: WeakSet<object>) => void): void;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Reads javascript values from a read buffer
|
|
102
|
+
*/
|
|
103
|
+
export interface ValueDecoder {
|
|
104
|
+
/**
|
|
105
|
+
* Reads a value from a read buffer. This method will be called for the decoder that is
|
|
106
|
+
* registered for the tag associated with the value encoder that encoded this value.
|
|
107
|
+
* @param buf The read buffer to read from
|
|
108
|
+
* @param recursiveDecode A function that will use the decoders registered on the {@link RpcMessageDecoder}
|
|
109
|
+
* to read values from the underlying read buffer. This is used mostly to decode structures like an array
|
|
110
|
+
* without having to know how to decode the values in the array.
|
|
111
|
+
*/
|
|
112
|
+
read(buf: ReadBuffer, recursiveDecode: (buf: ReadBuffer) => unknown): unknown;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Custom error thrown by the {@link RpcMessageEncoder} if an error occurred during the encoding and the
|
|
116
|
+
* object could not be written to the given {@link WriteBuffer}
|
|
117
|
+
*/
|
|
118
|
+
export declare class EncodingError extends Error {
|
|
119
|
+
constructor(msg: string);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A `RpcMessageDecoder` parses a a binary message received via {@link ReadBuffer} into a {@link RpcMessage}
|
|
123
|
+
*/
|
|
124
|
+
export declare class RpcMessageDecoder {
|
|
125
|
+
protected decoders: Map<number, ValueDecoder>;
|
|
126
|
+
constructor();
|
|
127
|
+
registerDecoders(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Registers a new {@link ValueDecoder} for the given tag.
|
|
130
|
+
* After the successful registration the {@link tagIntType} is recomputed
|
|
131
|
+
* by retrieving the highest tag value and calculating the required Uint size to store it.
|
|
132
|
+
* @param tag the tag for which the decoder should be registered.
|
|
133
|
+
* @param decoder the decoder that should be registered.
|
|
134
|
+
*/
|
|
135
|
+
registerDecoder(tag: number, decoder: ValueDecoder): void;
|
|
136
|
+
parse(buf: ReadBuffer): RpcMessage;
|
|
137
|
+
protected parseCancel(msg: ReadBuffer): CancelMessage;
|
|
138
|
+
protected parseRequest(msg: ReadBuffer): RequestMessage;
|
|
139
|
+
protected parseNotification(msg: ReadBuffer): NotificationMessage;
|
|
140
|
+
parseReply(msg: ReadBuffer): ReplyMessage;
|
|
141
|
+
parseReplyErr(msg: ReadBuffer): ReplyErrMessage;
|
|
142
|
+
readArray(buf: ReadBuffer): any[];
|
|
143
|
+
readTypedValue(buf: ReadBuffer): any;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A `RpcMessageEncoder` writes {@link RpcMessage} objects to a {@link WriteBuffer}. Note that it is
|
|
147
|
+
* up to clients to commit the message. This allows for multiple messages being
|
|
148
|
+
* encoded before sending.
|
|
149
|
+
*/
|
|
150
|
+
export declare class RpcMessageEncoder {
|
|
151
|
+
protected readonly encoders: [number, ValueEncoder][];
|
|
152
|
+
protected readonly registeredTags: Set<number>;
|
|
153
|
+
constructor();
|
|
154
|
+
protected registerEncoders(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Registers a new {@link ValueEncoder} for the given tag.
|
|
157
|
+
* After the successful registration the {@link tagIntType} is recomputed
|
|
158
|
+
* by retrieving the highest tag value and calculating the required Uint size to store it.
|
|
159
|
+
* @param tag the tag for which the encoder should be registered.
|
|
160
|
+
* @param decoder the encoder that should be registered.
|
|
161
|
+
*/
|
|
162
|
+
registerEncoder<T>(tag: number, encoder: ValueEncoder): void;
|
|
163
|
+
cancel(buf: WriteBuffer, requestId: number): void;
|
|
164
|
+
notification(buf: WriteBuffer, requestId: number, method: string, args: any[]): void;
|
|
165
|
+
request(buf: WriteBuffer, requestId: number, method: string, args: any[]): void;
|
|
166
|
+
replyOK(buf: WriteBuffer, requestId: number, res: any): void;
|
|
167
|
+
replyErr(buf: WriteBuffer, requestId: number, err: any): void;
|
|
168
|
+
writeTypedValue(buf: WriteBuffer, value: any, visitedObjects: WeakSet<object>): void;
|
|
169
|
+
writeArray(buf: WriteBuffer, value: any[], visitedObjects: WeakSet<object>): void;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=rpc-message-encoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-message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;IAO/E,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;IAM5D,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;IAM7D,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI;IA0BpF,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI;CAMpF"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.RpcMessageEncoder = exports.RpcMessageDecoder = exports.EncodingError = exports.ObjectType = exports.ResponseError = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* A special error that can be returned in case a request
|
|
22
|
+
* has failed. Provides additional information i.e. an error code
|
|
23
|
+
* and additional error data.
|
|
24
|
+
*/
|
|
25
|
+
class ResponseError extends Error {
|
|
26
|
+
constructor(code, message, data) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.data = data;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ResponseError = ResponseError;
|
|
33
|
+
/**
|
|
34
|
+
* The tag values for the default {@link ValueEncoder}s & {@link ValueDecoder}s
|
|
35
|
+
*/
|
|
36
|
+
var ObjectType;
|
|
37
|
+
(function (ObjectType) {
|
|
38
|
+
ObjectType[ObjectType["JSON"] = 0] = "JSON";
|
|
39
|
+
ObjectType[ObjectType["ByteArray"] = 1] = "ByteArray";
|
|
40
|
+
ObjectType[ObjectType["ObjectArray"] = 2] = "ObjectArray";
|
|
41
|
+
ObjectType[ObjectType["Undefined"] = 3] = "Undefined";
|
|
42
|
+
ObjectType[ObjectType["Object"] = 4] = "Object";
|
|
43
|
+
ObjectType[ObjectType["String"] = 5] = "String";
|
|
44
|
+
ObjectType[ObjectType["Boolean"] = 6] = "Boolean";
|
|
45
|
+
ObjectType[ObjectType["Number"] = 7] = "Number";
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
47
|
+
ObjectType[ObjectType["ResponseError"] = 8] = "ResponseError";
|
|
48
|
+
ObjectType[ObjectType["Error"] = 9] = "Error";
|
|
49
|
+
ObjectType[ObjectType["Map"] = 10] = "Map";
|
|
50
|
+
ObjectType[ObjectType["Set"] = 11] = "Set";
|
|
51
|
+
ObjectType[ObjectType["Function"] = 12] = "Function";
|
|
52
|
+
})(ObjectType = exports.ObjectType || (exports.ObjectType = {}));
|
|
53
|
+
/**
|
|
54
|
+
* Custom error thrown by the {@link RpcMessageEncoder} if an error occurred during the encoding and the
|
|
55
|
+
* object could not be written to the given {@link WriteBuffer}
|
|
56
|
+
*/
|
|
57
|
+
class EncodingError extends Error {
|
|
58
|
+
constructor(msg) {
|
|
59
|
+
super(msg);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.EncodingError = EncodingError;
|
|
63
|
+
/**
|
|
64
|
+
* A `RpcMessageDecoder` parses a a binary message received via {@link ReadBuffer} into a {@link RpcMessage}
|
|
65
|
+
*/
|
|
66
|
+
class RpcMessageDecoder {
|
|
67
|
+
constructor() {
|
|
68
|
+
this.decoders = new Map();
|
|
69
|
+
this.registerDecoders();
|
|
70
|
+
}
|
|
71
|
+
registerDecoders() {
|
|
72
|
+
this.registerDecoder(ObjectType.JSON, {
|
|
73
|
+
read: buf => {
|
|
74
|
+
const json = buf.readString();
|
|
75
|
+
return JSON.parse(json);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.registerDecoder(ObjectType.Error, {
|
|
79
|
+
read: buf => {
|
|
80
|
+
const serializedError = JSON.parse(buf.readString());
|
|
81
|
+
const error = new Error(serializedError.message);
|
|
82
|
+
Object.assign(error, serializedError);
|
|
83
|
+
return error;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
this.registerDecoder(ObjectType.ResponseError, {
|
|
87
|
+
read: buf => {
|
|
88
|
+
const error = JSON.parse(buf.readString());
|
|
89
|
+
return new ResponseError(error.code, error.message, error.data);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this.registerDecoder(ObjectType.ByteArray, {
|
|
93
|
+
read: buf => buf.readBytes()
|
|
94
|
+
});
|
|
95
|
+
this.registerDecoder(ObjectType.ObjectArray, {
|
|
96
|
+
read: buf => this.readArray(buf)
|
|
97
|
+
});
|
|
98
|
+
this.registerDecoder(ObjectType.Undefined, {
|
|
99
|
+
read: () => undefined
|
|
100
|
+
});
|
|
101
|
+
this.registerDecoder(ObjectType.Object, {
|
|
102
|
+
read: (buf, recursiveRead) => {
|
|
103
|
+
const propertyCount = buf.readLength();
|
|
104
|
+
const result = Object.create({});
|
|
105
|
+
for (let i = 0; i < propertyCount; i++) {
|
|
106
|
+
const key = buf.readString();
|
|
107
|
+
const value = recursiveRead(buf);
|
|
108
|
+
result[key] = value;
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
this.registerDecoder(ObjectType.String, {
|
|
114
|
+
read: (buf, recursiveRead) => buf.readString()
|
|
115
|
+
});
|
|
116
|
+
this.registerDecoder(ObjectType.Boolean, {
|
|
117
|
+
read: buf => buf.readUint8() === 1
|
|
118
|
+
});
|
|
119
|
+
this.registerDecoder(ObjectType.Number, {
|
|
120
|
+
read: buf => buf.readNumber()
|
|
121
|
+
});
|
|
122
|
+
this.registerDecoder(ObjectType.Map, {
|
|
123
|
+
read: buf => new Map(this.readArray(buf))
|
|
124
|
+
});
|
|
125
|
+
this.registerDecoder(ObjectType.Set, {
|
|
126
|
+
read: buf => new Set(this.readArray(buf))
|
|
127
|
+
});
|
|
128
|
+
this.registerDecoder(ObjectType.Function, {
|
|
129
|
+
read: () => ({})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Registers a new {@link ValueDecoder} for the given tag.
|
|
134
|
+
* After the successful registration the {@link tagIntType} is recomputed
|
|
135
|
+
* by retrieving the highest tag value and calculating the required Uint size to store it.
|
|
136
|
+
* @param tag the tag for which the decoder should be registered.
|
|
137
|
+
* @param decoder the decoder that should be registered.
|
|
138
|
+
*/
|
|
139
|
+
registerDecoder(tag, decoder) {
|
|
140
|
+
if (this.decoders.has(tag)) {
|
|
141
|
+
throw new Error(`Decoder already registered: ${tag}`);
|
|
142
|
+
}
|
|
143
|
+
this.decoders.set(tag, decoder);
|
|
144
|
+
}
|
|
145
|
+
parse(buf) {
|
|
146
|
+
try {
|
|
147
|
+
const msgType = buf.readUint8();
|
|
148
|
+
switch (msgType) {
|
|
149
|
+
case 1 /* Request */:
|
|
150
|
+
return this.parseRequest(buf);
|
|
151
|
+
case 2 /* Notification */:
|
|
152
|
+
return this.parseNotification(buf);
|
|
153
|
+
case 3 /* Reply */:
|
|
154
|
+
return this.parseReply(buf);
|
|
155
|
+
case 4 /* ReplyErr */:
|
|
156
|
+
return this.parseReplyErr(buf);
|
|
157
|
+
case 5 /* Cancel */:
|
|
158
|
+
return this.parseCancel(buf);
|
|
159
|
+
}
|
|
160
|
+
throw new Error(`Unknown message type: ${msgType}`);
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
// exception does not show problematic content: log it!
|
|
164
|
+
console.log('failed to parse message: ' + buf);
|
|
165
|
+
throw e;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
parseCancel(msg) {
|
|
169
|
+
const callId = msg.readUint32();
|
|
170
|
+
return {
|
|
171
|
+
type: 5 /* Cancel */,
|
|
172
|
+
id: callId
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
parseRequest(msg) {
|
|
176
|
+
const callId = msg.readUint32();
|
|
177
|
+
const method = msg.readString();
|
|
178
|
+
const args = this.readArray(msg);
|
|
179
|
+
return {
|
|
180
|
+
type: 1 /* Request */,
|
|
181
|
+
id: callId,
|
|
182
|
+
method: method,
|
|
183
|
+
args: args
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
parseNotification(msg) {
|
|
187
|
+
const callId = msg.readUint32();
|
|
188
|
+
const method = msg.readString();
|
|
189
|
+
const args = this.readArray(msg);
|
|
190
|
+
return {
|
|
191
|
+
type: 2 /* Notification */,
|
|
192
|
+
id: callId,
|
|
193
|
+
method: method,
|
|
194
|
+
args: args
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
parseReply(msg) {
|
|
198
|
+
const callId = msg.readUint32();
|
|
199
|
+
const value = this.readTypedValue(msg);
|
|
200
|
+
return {
|
|
201
|
+
type: 3 /* Reply */,
|
|
202
|
+
id: callId,
|
|
203
|
+
res: value
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
parseReplyErr(msg) {
|
|
207
|
+
const callId = msg.readUint32();
|
|
208
|
+
const err = this.readTypedValue(msg);
|
|
209
|
+
return {
|
|
210
|
+
type: 4 /* ReplyErr */,
|
|
211
|
+
id: callId,
|
|
212
|
+
err
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
readArray(buf) {
|
|
216
|
+
const length = buf.readLength();
|
|
217
|
+
const result = new Array(length);
|
|
218
|
+
for (let i = 0; i < length; i++) {
|
|
219
|
+
result[i] = this.readTypedValue(buf);
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
readTypedValue(buf) {
|
|
224
|
+
const type = buf.readUint8();
|
|
225
|
+
const decoder = this.decoders.get(type);
|
|
226
|
+
if (!decoder) {
|
|
227
|
+
throw new Error(`No decoder for tag ${type}`);
|
|
228
|
+
}
|
|
229
|
+
return decoder.read(buf, innerBuffer => this.readTypedValue(innerBuffer));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.RpcMessageDecoder = RpcMessageDecoder;
|
|
233
|
+
/**
|
|
234
|
+
* A `RpcMessageEncoder` writes {@link RpcMessage} objects to a {@link WriteBuffer}. Note that it is
|
|
235
|
+
* up to clients to commit the message. This allows for multiple messages being
|
|
236
|
+
* encoded before sending.
|
|
237
|
+
*/
|
|
238
|
+
class RpcMessageEncoder {
|
|
239
|
+
constructor() {
|
|
240
|
+
this.encoders = [];
|
|
241
|
+
this.registeredTags = new Set();
|
|
242
|
+
this.registerEncoders();
|
|
243
|
+
}
|
|
244
|
+
registerEncoders() {
|
|
245
|
+
// encoders will be consulted in reverse order of registration, so the JSON fallback needs to be last
|
|
246
|
+
this.registerEncoder(ObjectType.JSON, {
|
|
247
|
+
is: () => true,
|
|
248
|
+
write: (buf, value) => {
|
|
249
|
+
buf.writeString(JSON.stringify(value));
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
this.registerEncoder(ObjectType.Function, {
|
|
253
|
+
is: value => typeof value === 'function',
|
|
254
|
+
write: () => { }
|
|
255
|
+
});
|
|
256
|
+
this.registerEncoder(ObjectType.Object, {
|
|
257
|
+
is: value => typeof value === 'object',
|
|
258
|
+
write: (buf, object, visitedObjects, recursiveEncode) => {
|
|
259
|
+
const properties = Object.keys(object);
|
|
260
|
+
const relevant = [];
|
|
261
|
+
for (const property of properties) {
|
|
262
|
+
const value = object[property];
|
|
263
|
+
if (typeof value !== 'function') {
|
|
264
|
+
relevant.push([property, value]);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
buf.writeLength(relevant.length);
|
|
268
|
+
for (const [property, value] of relevant) {
|
|
269
|
+
buf.writeString(property);
|
|
270
|
+
recursiveEncode === null || recursiveEncode === void 0 ? void 0 : recursiveEncode(buf, value, visitedObjects);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
this.registerEncoder(ObjectType.Error, {
|
|
275
|
+
is: value => value instanceof Error,
|
|
276
|
+
write: (buf, error) => {
|
|
277
|
+
const { name, message } = error;
|
|
278
|
+
const stack = error.stacktrace || error.stack;
|
|
279
|
+
const serializedError = {
|
|
280
|
+
$isError: true,
|
|
281
|
+
name,
|
|
282
|
+
message,
|
|
283
|
+
stack
|
|
284
|
+
};
|
|
285
|
+
buf.writeString(JSON.stringify(serializedError));
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
this.registerEncoder(ObjectType.ResponseError, {
|
|
289
|
+
is: value => value instanceof ResponseError,
|
|
290
|
+
write: (buf, value) => buf.writeString(JSON.stringify(value))
|
|
291
|
+
});
|
|
292
|
+
this.registerEncoder(ObjectType.Map, {
|
|
293
|
+
is: value => value instanceof Map,
|
|
294
|
+
write: (buf, value, visitedObjects) => this.writeArray(buf, Array.from(value.entries()), visitedObjects)
|
|
295
|
+
});
|
|
296
|
+
this.registerEncoder(ObjectType.Set, {
|
|
297
|
+
is: value => value instanceof Set,
|
|
298
|
+
write: (buf, value, visitedObjects) => this.writeArray(buf, [...value], visitedObjects)
|
|
299
|
+
});
|
|
300
|
+
this.registerEncoder(ObjectType.Undefined, {
|
|
301
|
+
// eslint-disable-next-line no-null/no-null
|
|
302
|
+
is: value => value == null,
|
|
303
|
+
write: () => { }
|
|
304
|
+
});
|
|
305
|
+
this.registerEncoder(ObjectType.ObjectArray, {
|
|
306
|
+
is: value => Array.isArray(value),
|
|
307
|
+
write: (buf, value, visitedObjects) => {
|
|
308
|
+
this.writeArray(buf, value, visitedObjects);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
this.registerEncoder(ObjectType.ByteArray, {
|
|
312
|
+
is: value => value instanceof Uint8Array,
|
|
313
|
+
write: (buf, value) => {
|
|
314
|
+
buf.writeBytes(value);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
this.registerEncoder(ObjectType.String, {
|
|
318
|
+
is: value => typeof value === 'string',
|
|
319
|
+
write: (buf, value) => {
|
|
320
|
+
buf.writeString(value);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
this.registerEncoder(ObjectType.Boolean, {
|
|
324
|
+
is: value => typeof value === 'boolean',
|
|
325
|
+
write: (buf, value) => {
|
|
326
|
+
buf.writeUint8(value === true ? 1 : 0);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
this.registerEncoder(ObjectType.Number, {
|
|
330
|
+
is: value => typeof value === 'number',
|
|
331
|
+
write: (buf, value) => {
|
|
332
|
+
buf.writeNumber(value);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Registers a new {@link ValueEncoder} for the given tag.
|
|
338
|
+
* After the successful registration the {@link tagIntType} is recomputed
|
|
339
|
+
* by retrieving the highest tag value and calculating the required Uint size to store it.
|
|
340
|
+
* @param tag the tag for which the encoder should be registered.
|
|
341
|
+
* @param decoder the encoder that should be registered.
|
|
342
|
+
*/
|
|
343
|
+
registerEncoder(tag, encoder) {
|
|
344
|
+
if (this.registeredTags.has(tag)) {
|
|
345
|
+
throw new Error(`Tag already registered: ${tag}`);
|
|
346
|
+
}
|
|
347
|
+
this.registeredTags.add(tag);
|
|
348
|
+
this.encoders.push([tag, encoder]);
|
|
349
|
+
}
|
|
350
|
+
cancel(buf, requestId) {
|
|
351
|
+
buf.writeUint8(5 /* Cancel */);
|
|
352
|
+
buf.writeUint32(requestId);
|
|
353
|
+
}
|
|
354
|
+
notification(buf, requestId, method, args) {
|
|
355
|
+
buf.writeUint8(2 /* Notification */);
|
|
356
|
+
buf.writeUint32(requestId);
|
|
357
|
+
buf.writeString(method);
|
|
358
|
+
this.writeArray(buf, args, new WeakSet());
|
|
359
|
+
}
|
|
360
|
+
request(buf, requestId, method, args) {
|
|
361
|
+
buf.writeUint8(1 /* Request */);
|
|
362
|
+
buf.writeUint32(requestId);
|
|
363
|
+
buf.writeString(method);
|
|
364
|
+
this.writeArray(buf, args, new WeakSet());
|
|
365
|
+
}
|
|
366
|
+
replyOK(buf, requestId, res) {
|
|
367
|
+
buf.writeUint8(3 /* Reply */);
|
|
368
|
+
buf.writeUint32(requestId);
|
|
369
|
+
this.writeTypedValue(buf, res, new WeakSet());
|
|
370
|
+
}
|
|
371
|
+
replyErr(buf, requestId, err) {
|
|
372
|
+
buf.writeUint8(4 /* ReplyErr */);
|
|
373
|
+
buf.writeUint32(requestId);
|
|
374
|
+
this.writeTypedValue(buf, err, new WeakSet());
|
|
375
|
+
}
|
|
376
|
+
writeTypedValue(buf, value, visitedObjects) {
|
|
377
|
+
if (value && typeof value === 'object') {
|
|
378
|
+
if (visitedObjects.has(value)) {
|
|
379
|
+
throw new EncodingError('Object to encode contains circular references!');
|
|
380
|
+
}
|
|
381
|
+
visitedObjects.add(value);
|
|
382
|
+
}
|
|
383
|
+
try {
|
|
384
|
+
for (let i = this.encoders.length - 1; i >= 0; i--) {
|
|
385
|
+
if (this.encoders[i][1].is(value)) {
|
|
386
|
+
buf.writeUint8(this.encoders[i][0]);
|
|
387
|
+
this.encoders[i][1].write(buf, value, visitedObjects, (innerBuffer, innerValue, _visitedObjects) => {
|
|
388
|
+
this.writeTypedValue(innerBuffer, innerValue, _visitedObjects);
|
|
389
|
+
});
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
throw new EncodingError(`No suitable value encoder found for ${value}`);
|
|
394
|
+
}
|
|
395
|
+
finally {
|
|
396
|
+
if (value && typeof value === 'object') {
|
|
397
|
+
visitedObjects.delete(value);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
writeArray(buf, value, visitedObjects) {
|
|
402
|
+
buf.writeLength(value.length);
|
|
403
|
+
for (let i = 0; i < value.length; i++) {
|
|
404
|
+
this.writeTypedValue(buf, value[i], visitedObjects);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
exports.RpcMessageEncoder = RpcMessageEncoder;
|
|
409
|
+
//# sourceMappingURL=rpc-message-encoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-message-encoder.js","sourceRoot":"","sources":["../../../src/common/message-rpc/rpc-message-encoder.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;AAChF,uDAAuD;;;AA4DvD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,KAAK;IACpC,YAAqB,IAAY,EAAE,OAAe,EAAW,IAAS;QAClE,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,SAAI,GAAJ,IAAI,CAAQ;QAA4B,SAAI,GAAJ,IAAI,CAAK;IAEtE,CAAC;CACJ;AAJD,sCAIC;AAED;;GAEG;AAEH,IAAY,UAgBX;AAhBD,WAAY,UAAU;IAClB,2CAAQ,CAAA;IACR,qDAAa,CAAA;IACb,yDAAe,CAAA;IACf,qDAAa,CAAA;IACb,+CAAU,CAAA;IACV,+CAAU,CAAA;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AE,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;SACvD;IACL,CAAC;CACJ;AAjMD,8CAiMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-message-encoder.spec.d.ts","sourceRoot":"","sources":["../../../src/common/message-rpc/rpc-message-encoder.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const uint8_array_message_buffer_1 = require("./uint8-array-message-buffer");
|
|
20
|
+
const rpc_message_encoder_1 = require("./rpc-message-encoder");
|
|
21
|
+
describe('PPC Message Codex', () => {
|
|
22
|
+
describe('RPC Message Encoder & Decoder', () => {
|
|
23
|
+
it('should encode object into binary message and decode the message back into the original object', () => {
|
|
24
|
+
const buffer = new Uint8Array(1024);
|
|
25
|
+
const writer = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer(buffer);
|
|
26
|
+
const encoder = new rpc_message_encoder_1.RpcMessageEncoder();
|
|
27
|
+
const jsonMangled = JSON.parse(JSON.stringify(encoder));
|
|
28
|
+
// The RpcMessageEncoder can decode/encode collections, whereas JSON.parse can't. => We have to manually restore the set
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
jsonMangled.registeredTags = encoder.registeredTags;
|
|
31
|
+
encoder.writeTypedValue(writer, encoder, new WeakSet());
|
|
32
|
+
const written = writer.getCurrentContents();
|
|
33
|
+
const reader = new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(written);
|
|
34
|
+
const decoder = new rpc_message_encoder_1.RpcMessageDecoder();
|
|
35
|
+
const decoded = decoder.readTypedValue(reader);
|
|
36
|
+
(0, chai_1.expect)(decoded).deep.equal(jsonMangled);
|
|
37
|
+
});
|
|
38
|
+
it('should fail with an EncodingError when trying to encode the object ', () => {
|
|
39
|
+
const x = new Set();
|
|
40
|
+
const y = new Set();
|
|
41
|
+
x.add(y);
|
|
42
|
+
y.add(x);
|
|
43
|
+
const encoder = new rpc_message_encoder_1.RpcMessageEncoder();
|
|
44
|
+
const writer = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
45
|
+
(0, chai_1.expect)(() => encoder.writeTypedValue(writer, x, new WeakSet())).to.throw(rpc_message_encoder_1.EncodingError);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=rpc-message-encoder.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-message-encoder.spec.js","sourceRoot":"","sources":["../../../src/common/message-rpc/rpc-message-encoder.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,+BAA8B;AAC9B,6EAA2F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