@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
package/lib/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.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,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AACxB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,sDAAoC;AACpC,4CAA0B;AAC1B,uCAAqB;AACrB,6CAA2B;AAC3B,0DAAwC;AACxC,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B;AAC5B,oDAAkC;AAClC,6DAA2C;AAC3C,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,8CAA4B;AAC5B,4CAA0B;AAC1B,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,wCAAsB;AACtB,4CAA0B;AAC1B,gDAA8B;AAE9B,4EAAyE;AAChE,4FADA,yBAAW,OACA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.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,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AACxB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,sDAAoC;AACpC,4CAA0B;AAC1B,uCAAqB;AACrB,6CAA2B;AAC3B,0DAAwC;AACxC,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B;AAC5B,gDAA8B;AAC9B,oDAAkC;AAClC,6DAA2C;AAC3C,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,8CAA4B;AAC5B,4CAA0B;AAC1B,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,wCAAsB;AACtB,4CAA0B;AAC1B,gDAA8B;AAE9B,4EAAyE;AAChE,4FADA,yBAAW,OACA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Disposable, DisposableCollection } from '../disposable';
|
|
2
|
+
import { Emitter, Event } from '../event';
|
|
3
|
+
import { ReadBuffer, WriteBuffer } from './message-buffer';
|
|
4
|
+
/**
|
|
5
|
+
* A channel is a bidirectional communications channel with lifecycle and
|
|
6
|
+
* error signalling. Note that creation of channels is specific to particular
|
|
7
|
+
* implementations and thus not part of the protocol.
|
|
8
|
+
*/
|
|
9
|
+
export interface Channel {
|
|
10
|
+
/**
|
|
11
|
+
* The remote side has closed the channel
|
|
12
|
+
*/
|
|
13
|
+
onClose: Event<ChannelCloseEvent>;
|
|
14
|
+
/**
|
|
15
|
+
* An error has occurred while writing to or reading from the channel
|
|
16
|
+
*/
|
|
17
|
+
onError: Event<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* A message has arrived and can be read by listeners using a {@link MessageProvider}.
|
|
20
|
+
*/
|
|
21
|
+
onMessage: Event<MessageProvider>;
|
|
22
|
+
/**
|
|
23
|
+
* Obtain a {@link WriteBuffer} to write a message to the channel.
|
|
24
|
+
*/
|
|
25
|
+
getWriteBuffer(): WriteBuffer;
|
|
26
|
+
/**
|
|
27
|
+
* Close this channel. No {@link onClose} event should be sent
|
|
28
|
+
*/
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The event that is emitted when a channel is closed from the remote side.
|
|
33
|
+
*/
|
|
34
|
+
export interface ChannelCloseEvent {
|
|
35
|
+
reason: string;
|
|
36
|
+
code?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The `MessageProvider` is emitted when a channel receives a new message.
|
|
40
|
+
* Listeners can invoke the provider to obtain a new {@link ReadBuffer} for the received message.
|
|
41
|
+
* This ensures that each listener has its own isolated {@link ReadBuffer} instance.
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export declare type MessageProvider = () => ReadBuffer;
|
|
45
|
+
/**
|
|
46
|
+
* Helper class to implement the single channels on a {@link ChannelMultiplexer}. Simply forwards write requests to
|
|
47
|
+
* the given write buffer source i.e. the main channel of the {@link ChannelMultiplexer}.
|
|
48
|
+
*/
|
|
49
|
+
export declare class ForwardingChannel implements Channel {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
protected readonly closeHandler: () => void;
|
|
52
|
+
protected readonly writeBufferSource: () => WriteBuffer;
|
|
53
|
+
protected toDispose: DisposableCollection;
|
|
54
|
+
constructor(id: string, closeHandler: () => void, writeBufferSource: () => WriteBuffer);
|
|
55
|
+
onCloseEmitter: Emitter<ChannelCloseEvent>;
|
|
56
|
+
get onClose(): Event<ChannelCloseEvent>;
|
|
57
|
+
onErrorEmitter: Emitter<unknown>;
|
|
58
|
+
get onError(): Event<unknown>;
|
|
59
|
+
onMessageEmitter: Emitter<MessageProvider>;
|
|
60
|
+
get onMessage(): Event<MessageProvider>;
|
|
61
|
+
getWriteBuffer(): WriteBuffer;
|
|
62
|
+
close(): void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The different message types used in the messaging protocol of the {@link ChannelMultiplexer}
|
|
66
|
+
*/
|
|
67
|
+
export declare enum MessageTypes {
|
|
68
|
+
Open = 1,
|
|
69
|
+
Close = 2,
|
|
70
|
+
AckOpen = 3,
|
|
71
|
+
Data = 4
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The write buffers in this implementation immediately write to the underlying
|
|
75
|
+
* channel, so we rely on writers to the multiplexed channels to always commit their
|
|
76
|
+
* messages and always in one go.
|
|
77
|
+
*/
|
|
78
|
+
export declare class ChannelMultiplexer implements Disposable {
|
|
79
|
+
protected readonly underlyingChannel: Channel;
|
|
80
|
+
protected pendingOpen: Map<string, (channel: ForwardingChannel) => void>;
|
|
81
|
+
protected openChannels: Map<string, ForwardingChannel>;
|
|
82
|
+
protected readonly onOpenChannelEmitter: Emitter<{
|
|
83
|
+
id: string;
|
|
84
|
+
channel: Channel;
|
|
85
|
+
}>;
|
|
86
|
+
get onDidOpenChannel(): Event<{
|
|
87
|
+
id: string;
|
|
88
|
+
channel: Channel;
|
|
89
|
+
}>;
|
|
90
|
+
protected toDispose: DisposableCollection;
|
|
91
|
+
constructor(underlyingChannel: Channel);
|
|
92
|
+
protected handleError(error: unknown): void;
|
|
93
|
+
onUnderlyingChannelClose(event?: ChannelCloseEvent): void;
|
|
94
|
+
protected handleMessage(buffer: ReadBuffer): void;
|
|
95
|
+
protected handleAckOpen(id: string): void;
|
|
96
|
+
protected handleOpen(id: string): void;
|
|
97
|
+
protected handleClose(id: string): void;
|
|
98
|
+
protected handleData(id: string, data: ReadBuffer): void;
|
|
99
|
+
protected createChannel(id: string): ForwardingChannel;
|
|
100
|
+
protected prepareWriteBuffer(id: string): WriteBuffer;
|
|
101
|
+
protected closeChannel(id: string): void;
|
|
102
|
+
open(id: string): Promise<Channel>;
|
|
103
|
+
getOpenChannel(id: string): Channel | undefined;
|
|
104
|
+
dispose(): void;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/common/message-rpc/channel.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,OAAO;IAEpB;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,eAAe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+
// *****************************************************************************
|
|
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
|
+
exports.ChannelMultiplexer = exports.MessageTypes = exports.ForwardingChannel = void 0;
|
|
19
|
+
const disposable_1 = require("../disposable");
|
|
20
|
+
const event_1 = require("../event");
|
|
21
|
+
;
|
|
22
|
+
/**
|
|
23
|
+
* Helper class to implement the single channels on a {@link ChannelMultiplexer}. Simply forwards write requests to
|
|
24
|
+
* the given write buffer source i.e. the main channel of the {@link ChannelMultiplexer}.
|
|
25
|
+
*/
|
|
26
|
+
class ForwardingChannel {
|
|
27
|
+
constructor(id, closeHandler, writeBufferSource) {
|
|
28
|
+
this.id = id;
|
|
29
|
+
this.closeHandler = closeHandler;
|
|
30
|
+
this.writeBufferSource = writeBufferSource;
|
|
31
|
+
this.toDispose = new disposable_1.DisposableCollection();
|
|
32
|
+
this.onCloseEmitter = new event_1.Emitter();
|
|
33
|
+
this.onErrorEmitter = new event_1.Emitter();
|
|
34
|
+
this.onMessageEmitter = new event_1.Emitter();
|
|
35
|
+
this.toDispose.pushAll([this.onCloseEmitter, this.onErrorEmitter, this.onMessageEmitter]);
|
|
36
|
+
}
|
|
37
|
+
get onClose() {
|
|
38
|
+
return this.onCloseEmitter.event;
|
|
39
|
+
}
|
|
40
|
+
;
|
|
41
|
+
get onError() {
|
|
42
|
+
return this.onErrorEmitter.event;
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
get onMessage() {
|
|
46
|
+
return this.onMessageEmitter.event;
|
|
47
|
+
}
|
|
48
|
+
;
|
|
49
|
+
getWriteBuffer() {
|
|
50
|
+
return this.writeBufferSource();
|
|
51
|
+
}
|
|
52
|
+
close() {
|
|
53
|
+
this.closeHandler();
|
|
54
|
+
this.toDispose.dispose();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.ForwardingChannel = ForwardingChannel;
|
|
58
|
+
/**
|
|
59
|
+
* The different message types used in the messaging protocol of the {@link ChannelMultiplexer}
|
|
60
|
+
*/
|
|
61
|
+
var MessageTypes;
|
|
62
|
+
(function (MessageTypes) {
|
|
63
|
+
MessageTypes[MessageTypes["Open"] = 1] = "Open";
|
|
64
|
+
MessageTypes[MessageTypes["Close"] = 2] = "Close";
|
|
65
|
+
MessageTypes[MessageTypes["AckOpen"] = 3] = "AckOpen";
|
|
66
|
+
MessageTypes[MessageTypes["Data"] = 4] = "Data";
|
|
67
|
+
})(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
|
|
68
|
+
/**
|
|
69
|
+
* The write buffers in this implementation immediately write to the underlying
|
|
70
|
+
* channel, so we rely on writers to the multiplexed channels to always commit their
|
|
71
|
+
* messages and always in one go.
|
|
72
|
+
*/
|
|
73
|
+
class ChannelMultiplexer {
|
|
74
|
+
constructor(underlyingChannel) {
|
|
75
|
+
this.underlyingChannel = underlyingChannel;
|
|
76
|
+
this.pendingOpen = new Map();
|
|
77
|
+
this.openChannels = new Map();
|
|
78
|
+
this.onOpenChannelEmitter = new event_1.Emitter();
|
|
79
|
+
this.toDispose = new disposable_1.DisposableCollection();
|
|
80
|
+
this.toDispose.pushAll([
|
|
81
|
+
this.underlyingChannel.onMessage(buffer => this.handleMessage(buffer())),
|
|
82
|
+
this.underlyingChannel.onClose(event => this.onUnderlyingChannelClose(event)),
|
|
83
|
+
this.underlyingChannel.onError(error => this.handleError(error)),
|
|
84
|
+
this.onOpenChannelEmitter
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
get onDidOpenChannel() {
|
|
88
|
+
return this.onOpenChannelEmitter.event;
|
|
89
|
+
}
|
|
90
|
+
handleError(error) {
|
|
91
|
+
this.openChannels.forEach(channel => {
|
|
92
|
+
channel.onErrorEmitter.fire(error);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
onUnderlyingChannelClose(event) {
|
|
96
|
+
if (!this.toDispose.disposed) {
|
|
97
|
+
this.toDispose.push(disposable_1.Disposable.create(() => {
|
|
98
|
+
this.pendingOpen.clear();
|
|
99
|
+
this.openChannels.forEach(channel => {
|
|
100
|
+
channel.onCloseEmitter.fire(event !== null && event !== void 0 ? event : { reason: 'Multiplexer main channel has been closed from the remote side!' });
|
|
101
|
+
});
|
|
102
|
+
this.openChannels.clear();
|
|
103
|
+
}));
|
|
104
|
+
this.dispose();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
handleMessage(buffer) {
|
|
108
|
+
const type = buffer.readUint8();
|
|
109
|
+
const id = buffer.readString();
|
|
110
|
+
switch (type) {
|
|
111
|
+
case MessageTypes.AckOpen: {
|
|
112
|
+
return this.handleAckOpen(id);
|
|
113
|
+
}
|
|
114
|
+
case MessageTypes.Open: {
|
|
115
|
+
return this.handleOpen(id);
|
|
116
|
+
}
|
|
117
|
+
case MessageTypes.Close: {
|
|
118
|
+
return this.handleClose(id);
|
|
119
|
+
}
|
|
120
|
+
case MessageTypes.Data: {
|
|
121
|
+
return this.handleData(id, buffer.sliceAtReadPosition());
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
handleAckOpen(id) {
|
|
126
|
+
// edge case: both side try to open a channel at the same time.
|
|
127
|
+
const resolve = this.pendingOpen.get(id);
|
|
128
|
+
if (resolve) {
|
|
129
|
+
const channel = this.createChannel(id);
|
|
130
|
+
this.pendingOpen.delete(id);
|
|
131
|
+
this.openChannels.set(id, channel);
|
|
132
|
+
resolve(channel);
|
|
133
|
+
this.onOpenChannelEmitter.fire({ id, channel });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
handleOpen(id) {
|
|
137
|
+
if (!this.openChannels.has(id)) {
|
|
138
|
+
const channel = this.createChannel(id);
|
|
139
|
+
this.openChannels.set(id, channel);
|
|
140
|
+
const resolve = this.pendingOpen.get(id);
|
|
141
|
+
if (resolve) {
|
|
142
|
+
// edge case: both side try to open a channel at the same time.
|
|
143
|
+
resolve(channel);
|
|
144
|
+
}
|
|
145
|
+
this.underlyingChannel.getWriteBuffer().writeUint8(MessageTypes.AckOpen).writeString(id).commit();
|
|
146
|
+
this.onOpenChannelEmitter.fire({ id, channel });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
handleClose(id) {
|
|
150
|
+
const channel = this.openChannels.get(id);
|
|
151
|
+
if (channel) {
|
|
152
|
+
channel.onCloseEmitter.fire({ reason: 'Channel has been closed from the remote side' });
|
|
153
|
+
this.openChannels.delete(id);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
handleData(id, data) {
|
|
157
|
+
const channel = this.openChannels.get(id);
|
|
158
|
+
if (channel) {
|
|
159
|
+
channel.onMessageEmitter.fire(() => data);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
createChannel(id) {
|
|
163
|
+
return new ForwardingChannel(id, () => this.closeChannel(id), () => this.prepareWriteBuffer(id));
|
|
164
|
+
}
|
|
165
|
+
// Prepare the write buffer for the channel with the give, id. The channel id has to be encoded
|
|
166
|
+
// and written to the buffer before the actual message.
|
|
167
|
+
prepareWriteBuffer(id) {
|
|
168
|
+
const underlying = this.underlyingChannel.getWriteBuffer();
|
|
169
|
+
underlying.writeUint8(MessageTypes.Data);
|
|
170
|
+
underlying.writeString(id);
|
|
171
|
+
return underlying;
|
|
172
|
+
}
|
|
173
|
+
closeChannel(id) {
|
|
174
|
+
this.underlyingChannel.getWriteBuffer()
|
|
175
|
+
.writeUint8(MessageTypes.Close)
|
|
176
|
+
.writeString(id)
|
|
177
|
+
.commit();
|
|
178
|
+
this.openChannels.delete(id);
|
|
179
|
+
}
|
|
180
|
+
open(id) {
|
|
181
|
+
const result = new Promise((resolve, reject) => {
|
|
182
|
+
this.pendingOpen.set(id, resolve);
|
|
183
|
+
});
|
|
184
|
+
this.underlyingChannel.getWriteBuffer().writeUint8(MessageTypes.Open).writeString(id).commit();
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
getOpenChannel(id) {
|
|
188
|
+
return this.openChannels.get(id);
|
|
189
|
+
}
|
|
190
|
+
dispose() {
|
|
191
|
+
this.toDispose.dispose();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
exports.ChannelMultiplexer = ChannelMultiplexer;
|
|
195
|
+
//# sourceMappingURL=channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/common/message-rpc/channel.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,8CAAiE;AACjE,oCAA0C;AA0CzC,CAAC;AAUF;;;GAGG;AACH,MAAa,iBAAiB;IAG1B,YAAqB,EAAU,EAAqB,YAAwB,EAAqB,iBAAoC;QAAhH,OAAE,GAAF,EAAE,CAAQ;QAAqB,iBAAY,GAAZ,YAAY,CAAY;QAAqB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAD3H,cAAS,GAAG,IAAI,iCAAoB,EAAE,CAAC;QAKjD,mBAAc,GAA+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,CAAC;IAED,+FAA+F;IAC/F,uDAAuD;IAC7C,kBAAkB,CAAC,EAAU;QACnC,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAC3D,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACzC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC3B,OAAO,UAAU,CAAC;IACtB,CAAC;IAES,YAAY,CAAC,EAAU;QAC7B,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE;aAClC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC;aAC9B,WAAW,CAAC,EAAE,CAAC;aACf,MAAM,EAAE,CAAC;QAEd,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,CAAC,EAAU;QACX,MAAM,MAAM,GAAG,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QAC/F,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ;AA1ID,gDA0IC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ForwardingChannel } from './channel';
|
|
2
|
+
/**
|
|
3
|
+
* A pipe with two channels at each end for testing.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ChannelPipe {
|
|
6
|
+
readonly left: ForwardingChannel;
|
|
7
|
+
readonly right: ForwardingChannel;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=channel.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.spec.d.ts","sourceRoot":"","sources":["../../../src/common/message-rpc/channel.spec.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAsB,iBAAiB,EAAmB,MAAM,WAAW,CAAC;AAInF;;GAEG;AACH,qBAAa,WAAW;IACpB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAM7B;IACH,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAM9B;CACN"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
exports.ChannelPipe = void 0;
|
|
19
|
+
const chai_1 = require("chai");
|
|
20
|
+
const spies = require("chai-spies");
|
|
21
|
+
const uint8_array_message_buffer_1 = require("./uint8-array-message-buffer");
|
|
22
|
+
const channel_1 = require("./channel");
|
|
23
|
+
(0, chai_1.use)(spies);
|
|
24
|
+
/**
|
|
25
|
+
* A pipe with two channels at each end for testing.
|
|
26
|
+
*/
|
|
27
|
+
class ChannelPipe {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.left = new channel_1.ForwardingChannel('left', () => this.right.onCloseEmitter.fire({ reason: 'Left channel has been closed' }), () => {
|
|
30
|
+
const leftWrite = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
31
|
+
leftWrite.onCommit(buffer => {
|
|
32
|
+
this.right.onMessageEmitter.fire(() => new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer));
|
|
33
|
+
});
|
|
34
|
+
return leftWrite;
|
|
35
|
+
});
|
|
36
|
+
this.right = new channel_1.ForwardingChannel('right', () => this.left.onCloseEmitter.fire({ reason: 'Right channel has been closed' }), () => {
|
|
37
|
+
const rightWrite = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
38
|
+
rightWrite.onCommit(buffer => {
|
|
39
|
+
this.left.onMessageEmitter.fire(() => new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer));
|
|
40
|
+
});
|
|
41
|
+
return rightWrite;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ChannelPipe = ChannelPipe;
|
|
46
|
+
describe('Message Channel', () => {
|
|
47
|
+
describe('Channel multiplexer', () => {
|
|
48
|
+
it('should forward messages to intended target channel', async () => {
|
|
49
|
+
const pipe = new ChannelPipe();
|
|
50
|
+
const leftMultiplexer = new channel_1.ChannelMultiplexer(pipe.left);
|
|
51
|
+
const rightMultiplexer = new channel_1.ChannelMultiplexer(pipe.right);
|
|
52
|
+
const openChannelSpy = (0, chai_1.spy)(() => {
|
|
53
|
+
});
|
|
54
|
+
rightMultiplexer.onDidOpenChannel(openChannelSpy);
|
|
55
|
+
leftMultiplexer.onDidOpenChannel(openChannelSpy);
|
|
56
|
+
const leftFirst = await leftMultiplexer.open('first');
|
|
57
|
+
const leftSecond = await leftMultiplexer.open('second');
|
|
58
|
+
const rightFirst = rightMultiplexer.getOpenChannel('first');
|
|
59
|
+
const rightSecond = rightMultiplexer.getOpenChannel('second');
|
|
60
|
+
chai_1.assert.isNotNull(rightFirst);
|
|
61
|
+
chai_1.assert.isNotNull(rightSecond);
|
|
62
|
+
const leftSecondSpy = (0, chai_1.spy)((buf) => {
|
|
63
|
+
const message = buf().readString();
|
|
64
|
+
(0, chai_1.expect)(message).equal('message for second');
|
|
65
|
+
});
|
|
66
|
+
leftSecond.onMessage(leftSecondSpy);
|
|
67
|
+
const rightFirstSpy = (0, chai_1.spy)((buf) => {
|
|
68
|
+
const message = buf().readString();
|
|
69
|
+
(0, chai_1.expect)(message).equal('message for first');
|
|
70
|
+
});
|
|
71
|
+
rightFirst.onMessage(rightFirstSpy);
|
|
72
|
+
leftFirst.getWriteBuffer().writeString('message for first').commit();
|
|
73
|
+
rightSecond.getWriteBuffer().writeString('message for second').commit();
|
|
74
|
+
(0, chai_1.expect)(leftSecondSpy).to.be.called();
|
|
75
|
+
(0, chai_1.expect)(rightFirstSpy).to.be.called();
|
|
76
|
+
(0, chai_1.expect)(openChannelSpy).to.be.called.exactly(4);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=channel.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.spec.js","sourceRoot":"","sources":["../../../src/common/message-rpc/channel.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,+BAAgD;AAChD,oCAAoC;AACpC,6EAA2F;AAC3F,uCAAmF;AAEnF,IAAA,UAAG,EAAC,KAAK,CAAC,CAAC;AAEX;;GAEG;AACH,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AAS,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC;YACrE,WAAY,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE,CAAC;YAEzE,IAAA,aAAM,EAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;YACrC,IAAA,aAAM,EAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;YAErC,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/message-rpc/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcProtocol = void 0;
|
|
2
4
|
// *****************************************************************************
|
|
3
|
-
// Copyright (C)
|
|
5
|
+
// Copyright (C) 2022 STMicroelectronics and others.
|
|
4
6
|
//
|
|
5
7
|
// This program and the accompanying materials are made available under the
|
|
6
8
|
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,21 +16,6 @@
|
|
|
14
16
|
//
|
|
15
17
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
18
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
exports
|
|
19
|
-
|
|
20
|
-
error(message) {
|
|
21
|
-
console.log(message);
|
|
22
|
-
}
|
|
23
|
-
warn(message) {
|
|
24
|
-
console.log(message);
|
|
25
|
-
}
|
|
26
|
-
info(message) {
|
|
27
|
-
console.log(message);
|
|
28
|
-
}
|
|
29
|
-
log(message) {
|
|
30
|
-
console.log(message);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.ConsoleLogger = ConsoleLogger;
|
|
34
|
-
//# sourceMappingURL=logger.js.map
|
|
19
|
+
var rpc_protocol_1 = require("./rpc-protocol");
|
|
20
|
+
Object.defineProperty(exports, "RpcProtocol", { enumerable: true, get: function () { return rpc_protocol_1.RpcProtocol; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/message-rpc/index.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,+CAAiF;AAAxD,2GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A buffer maintaining a write position capable of writing primitive values
|
|
3
|
+
*/
|
|
4
|
+
export interface WriteBuffer {
|
|
5
|
+
writeUint8(byte: number): this;
|
|
6
|
+
writeUint16(value: number): this;
|
|
7
|
+
writeUint32(value: number): this;
|
|
8
|
+
writeString(value: string): this;
|
|
9
|
+
writeBytes(value: Uint8Array): this;
|
|
10
|
+
writeNumber(value: number): this;
|
|
11
|
+
writeLength(value: number): this;
|
|
12
|
+
/**
|
|
13
|
+
* Makes any writes to the buffer permanent, for example by sending the writes over a channel.
|
|
14
|
+
* You must obtain a new write buffer after committing
|
|
15
|
+
*/
|
|
16
|
+
commit(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class ForwardingWriteBuffer implements WriteBuffer {
|
|
19
|
+
protected readonly underlying: WriteBuffer;
|
|
20
|
+
constructor(underlying: WriteBuffer);
|
|
21
|
+
writeUint8(byte: number): this;
|
|
22
|
+
writeUint16(value: number): this;
|
|
23
|
+
writeUint32(value: number): this;
|
|
24
|
+
writeLength(value: number): this;
|
|
25
|
+
writeString(value: string): this;
|
|
26
|
+
writeBytes(value: Uint8Array): this;
|
|
27
|
+
writeNumber(value: number): this;
|
|
28
|
+
commit(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A buffer maintaining a read position in a buffer containing a received message capable of
|
|
32
|
+
* reading primitive values.
|
|
33
|
+
*/
|
|
34
|
+
export interface ReadBuffer {
|
|
35
|
+
readUint8(): number;
|
|
36
|
+
readUint16(): number;
|
|
37
|
+
readUint32(): number;
|
|
38
|
+
readString(): string;
|
|
39
|
+
readNumber(): number;
|
|
40
|
+
readLength(): number;
|
|
41
|
+
readBytes(): Uint8Array;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a new read buffer whose starting read position is the current read position of this buffer.
|
|
44
|
+
* This is useful to create read buffers sub messages.
|
|
45
|
+
* (e.g. when using a multiplexer the beginning of the message might contain some protocol overhead which should not be part
|
|
46
|
+
* of the message reader that is sent to the target channel)
|
|
47
|
+
*/
|
|
48
|
+
sliceAtReadPosition(): ReadBuffer;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=message-buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-buffer.d.ts","sourceRoot":"","sources":["../../../src/common/message-rpc/message-buffer.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,CAAC,IAAI,EAA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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
|
+
exports.ForwardingWriteBuffer = void 0;
|
|
19
|
+
class ForwardingWriteBuffer {
|
|
20
|
+
constructor(underlying) {
|
|
21
|
+
this.underlying = underlying;
|
|
22
|
+
}
|
|
23
|
+
writeUint8(byte) {
|
|
24
|
+
this.underlying.writeUint8(byte);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
writeUint16(value) {
|
|
28
|
+
this.underlying.writeUint16(value);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
writeUint32(value) {
|
|
32
|
+
this.underlying.writeUint32(value);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
writeLength(value) {
|
|
36
|
+
this.underlying.writeLength(value);
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
writeString(value) {
|
|
40
|
+
this.underlying.writeString(value);
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
writeBytes(value) {
|
|
44
|
+
this.underlying.writeBytes(value);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
writeNumber(value) {
|
|
48
|
+
this.underlying.writeNumber(value);
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
commit() {
|
|
52
|
+
this.underlying.commit();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ForwardingWriteBuffer = ForwardingWriteBuffer;
|
|
56
|
+
//# sourceMappingURL=message-buffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-buffer.js","sourceRoot":"","sources":["../../../src/common/message-rpc/message-buffer.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;;;AAoBhF,MAAa,qBAAqB;IAC9B,YAA+B,UAAuB;QAAvB,eAAU,GAAV,UAAU,CAAa;IACtD,CAAC;IAED,UAAU,CAAC,IAAY;QACnB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU,C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