@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
|
@@ -18,19 +18,15 @@ import * as http from 'http';
|
|
|
18
18
|
import * as https from 'https';
|
|
19
19
|
import { Server, Socket } from 'socket.io';
|
|
20
20
|
import { injectable, inject, named, postConstruct, interfaces, Container } from 'inversify';
|
|
21
|
-
import { MessageConnection } from 'vscode-ws-jsonrpc';
|
|
22
|
-
import { createWebSocketConnection } from 'vscode-ws-jsonrpc/lib/socket/connection';
|
|
23
|
-
import { IConnection } from 'vscode-ws-jsonrpc/lib/server/connection';
|
|
24
|
-
import * as launch from 'vscode-ws-jsonrpc/lib/server/launch';
|
|
25
21
|
import { ContributionProvider, ConnectionHandler, bindContributionProvider } from '../../common';
|
|
26
|
-
import { WebSocketChannel } from '../../common/messaging/web-socket-channel';
|
|
22
|
+
import { IWebSocket, WebSocketChannel } from '../../common/messaging/web-socket-channel';
|
|
27
23
|
import { BackendApplicationContribution } from '../backend-application';
|
|
28
|
-
import { MessagingService
|
|
29
|
-
import { ConsoleLogger } from './logger';
|
|
24
|
+
import { MessagingService } from './messaging-service';
|
|
30
25
|
import { ConnectionContainerModule } from './connection-container-module';
|
|
31
26
|
import Route = require('route-parser');
|
|
32
27
|
import { WsRequestValidator } from '../ws-request-validators';
|
|
33
28
|
import { MessagingListener } from './messaging-listeners';
|
|
29
|
+
import { Channel, ChannelMultiplexer } from '../../common/message-rpc/channel';
|
|
34
30
|
|
|
35
31
|
export const MessagingContainer = Symbol('MessagingContainer');
|
|
36
32
|
|
|
@@ -53,7 +49,7 @@ export class MessagingContribution implements BackendApplicationContribution, Me
|
|
|
53
49
|
protected readonly messagingListener: MessagingListener;
|
|
54
50
|
|
|
55
51
|
protected readonly wsHandlers = new MessagingContribution.ConnectionHandlers<Socket>();
|
|
56
|
-
protected readonly channelHandlers = new MessagingContribution.ConnectionHandlers<
|
|
52
|
+
protected readonly channelHandlers = new MessagingContribution.ConnectionHandlers<Channel>();
|
|
57
53
|
|
|
58
54
|
@postConstruct()
|
|
59
55
|
protected init(): void {
|
|
@@ -63,21 +59,7 @@ export class MessagingContribution implements BackendApplicationContribution, Me
|
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
this.wsChannel(spec, (params, channel) => {
|
|
68
|
-
const connection = createWebSocketConnection(channel, new ConsoleLogger());
|
|
69
|
-
callback(params, connection);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
forward(spec: string, callback: (params: MessagingService.PathParams, connection: IConnection) => void): void {
|
|
74
|
-
this.wsChannel(spec, (params, channel) => {
|
|
75
|
-
const connection = launch.createWebSocketConnection(channel);
|
|
76
|
-
callback(params, WebSocketChannelConnection.create(connection, channel));
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
wsChannel(spec: string, callback: (params: MessagingService.PathParams, channel: WebSocketChannel) => void): void {
|
|
62
|
+
wsChannel(spec: string, callback: (params: MessagingService.PathParams, channel: Channel) => void): void {
|
|
81
63
|
this.channelHandlers.push(spec, (params, channel) => callback(params, channel));
|
|
82
64
|
}
|
|
83
65
|
|
|
@@ -125,49 +107,31 @@ export class MessagingContribution implements BackendApplicationContribution, Me
|
|
|
125
107
|
}
|
|
126
108
|
|
|
127
109
|
protected handleChannels(socket: Socket): void {
|
|
110
|
+
const socketChannel = new WebSocketChannel(this.toIWebSocket(socket));
|
|
111
|
+
const multiplexer = new ChannelMultiplexer(socketChannel);
|
|
128
112
|
const channelHandlers = this.getConnectionChannelHandlers(socket);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (message.kind === 'open') {
|
|
134
|
-
const { id, path } = message;
|
|
135
|
-
const channel = this.createChannel(id, socket);
|
|
136
|
-
if (channelHandlers.route(path, channel)) {
|
|
137
|
-
channel.ready();
|
|
138
|
-
console.debug(`Opening channel for service path '${path}'. [ID: ${id}]`);
|
|
139
|
-
channels.set(id, channel);
|
|
140
|
-
channel.onClose(() => {
|
|
141
|
-
console.debug(`Closing channel on service path '${path}'. [ID: ${id}]`);
|
|
142
|
-
channels.delete(id);
|
|
143
|
-
});
|
|
144
|
-
} else {
|
|
145
|
-
console.error('Cannot find a service for the path: ' + path);
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
const { id } = message;
|
|
149
|
-
const channel = channels.get(id);
|
|
150
|
-
if (channel) {
|
|
151
|
-
channel.handleMessage(message);
|
|
152
|
-
} else {
|
|
153
|
-
console.error('The ws channel does not exist', id);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
} catch (error) {
|
|
157
|
-
console.error('Failed to handle message', { error, data });
|
|
113
|
+
multiplexer.onDidOpenChannel(event => {
|
|
114
|
+
if (channelHandlers.route(event.id, event.channel)) {
|
|
115
|
+
console.debug(`Opening channel for service path '${event.id}'.`);
|
|
116
|
+
event.channel.onClose(() => console.debug(`Closing channel on service path '${event.id}'.`));
|
|
158
117
|
}
|
|
159
118
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
protected toIWebSocket(socket: Socket): IWebSocket {
|
|
122
|
+
return {
|
|
123
|
+
close: () => {
|
|
124
|
+
socket.removeAllListeners('disconnect');
|
|
125
|
+
socket.removeAllListeners('error');
|
|
126
|
+
socket.removeAllListeners('message');
|
|
127
|
+
socket.disconnect();
|
|
128
|
+
},
|
|
129
|
+
isConnected: () => socket.connected,
|
|
130
|
+
onClose: cb => socket.on('disconnect', reason => cb(reason)),
|
|
131
|
+
onError: cb => socket.on('error', error => cb(error)),
|
|
132
|
+
onMessage: cb => socket.on('message', data => cb(data)),
|
|
133
|
+
send: message => socket.emit('message', message)
|
|
134
|
+
};
|
|
171
135
|
}
|
|
172
136
|
|
|
173
137
|
protected createSocketContainer(socket: Socket): Container {
|
|
@@ -176,7 +140,7 @@ export class MessagingContribution implements BackendApplicationContribution, Me
|
|
|
176
140
|
return connectionContainer;
|
|
177
141
|
}
|
|
178
142
|
|
|
179
|
-
protected getConnectionChannelHandlers(socket: Socket): MessagingContribution.ConnectionHandlers<
|
|
143
|
+
protected getConnectionChannelHandlers(socket: Socket): MessagingContribution.ConnectionHandlers<Channel> {
|
|
180
144
|
const connectionContainer = this.createSocketContainer(socket);
|
|
181
145
|
bindContributionProvider(connectionContainer, ConnectionHandler);
|
|
182
146
|
connectionContainer.load(...this.connectionModules.getContributions());
|
|
@@ -184,21 +148,12 @@ export class MessagingContribution implements BackendApplicationContribution, Me
|
|
|
184
148
|
const connectionHandlers = connectionContainer.getNamed<ContributionProvider<ConnectionHandler>>(ContributionProvider, ConnectionHandler);
|
|
185
149
|
for (const connectionHandler of connectionHandlers.getContributions(true)) {
|
|
186
150
|
connectionChannelHandlers.push(connectionHandler.path, (_, channel) => {
|
|
187
|
-
|
|
188
|
-
connectionHandler.onConnection(connection);
|
|
151
|
+
connectionHandler.onConnection(channel);
|
|
189
152
|
});
|
|
190
153
|
}
|
|
191
154
|
return connectionChannelHandlers;
|
|
192
155
|
}
|
|
193
156
|
|
|
194
|
-
protected createChannel(id: number, socket: Socket): WebSocketChannel {
|
|
195
|
-
return new WebSocketChannel(id, content => {
|
|
196
|
-
if (socket.connected) {
|
|
197
|
-
socket.send(content);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
157
|
}
|
|
203
158
|
|
|
204
159
|
export namespace MessagingContribution {
|
|
@@ -15,33 +15,21 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { Socket } from 'socket.io';
|
|
18
|
-
import {
|
|
19
|
-
import { IConnection } from 'vscode-ws-jsonrpc/lib/server/connection';
|
|
20
|
-
import { WebSocketChannel } from '../../common/messaging/web-socket-channel';
|
|
18
|
+
import { Channel } from '../../common/message-rpc/channel';
|
|
21
19
|
|
|
22
20
|
export interface MessagingService {
|
|
23
|
-
/**
|
|
24
|
-
* Accept a JSON-RPC connection on the given path.
|
|
25
|
-
* A path supports the route syntax: https://github.com/rcs/route-parser#what-can-i-use-in-my-routes.
|
|
26
|
-
*/
|
|
27
|
-
listen(path: string, callback: (params: MessagingService.PathParams, connection: MessageConnection) => void): void;
|
|
28
|
-
/**
|
|
29
|
-
* Accept a raw JSON-RPC connection on the given path.
|
|
30
|
-
* A path supports the route syntax: https://github.com/rcs/route-parser#what-can-i-use-in-my-routes.
|
|
31
|
-
*/
|
|
32
|
-
forward(path: string, callback: (params: MessagingService.PathParams, connection: IConnection) => void): void;
|
|
33
21
|
/**
|
|
34
22
|
* Accept a web socket channel on the given path.
|
|
35
23
|
* A path supports the route syntax: https://github.com/rcs/route-parser#what-can-i-use-in-my-routes.
|
|
36
24
|
*/
|
|
37
|
-
wsChannel(path: string, callback: (params: MessagingService.PathParams,
|
|
25
|
+
wsChannel(path: string, callback: (params: MessagingService.PathParams, channel: Channel) => void): void;
|
|
38
26
|
/**
|
|
39
27
|
* Accept a web socket connection on the given path.
|
|
40
28
|
* A path supports the route syntax: https://github.com/rcs/route-parser#what-can-i-use-in-my-routes.
|
|
41
29
|
*
|
|
42
30
|
* #### Important
|
|
43
|
-
* Prefer
|
|
44
|
-
* and excessive amount can cause performance degradation. All
|
|
31
|
+
* Prefer using web socket channels over establishing new web socket connection. Clients can handle only limited amount of web sockets
|
|
32
|
+
* and excessive amount can cause performance degradation. All web socket channels share a single web socket connection.
|
|
45
33
|
*/
|
|
46
34
|
ws(path: string, callback: (params: MessagingService.PathParams, socket: Socket) => void): void;
|
|
47
35
|
}
|
|
@@ -56,18 +44,3 @@ export namespace MessagingService {
|
|
|
56
44
|
configure(service: MessagingService): void;
|
|
57
45
|
}
|
|
58
46
|
}
|
|
59
|
-
|
|
60
|
-
export interface WebSocketChannelConnection extends IConnection {
|
|
61
|
-
channel: WebSocketChannel;
|
|
62
|
-
}
|
|
63
|
-
export namespace WebSocketChannelConnection {
|
|
64
|
-
export function is(connection: IConnection): connection is WebSocketChannelConnection {
|
|
65
|
-
return (connection as WebSocketChannelConnection).channel instanceof WebSocketChannel;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function create(connection: IConnection, channel: WebSocketChannel): WebSocketChannelConnection {
|
|
69
|
-
const result = connection as WebSocketChannelConnection;
|
|
70
|
-
result.channel = channel;
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
@@ -16,32 +16,41 @@
|
|
|
16
16
|
|
|
17
17
|
import * as http from 'http';
|
|
18
18
|
import * as https from 'https';
|
|
19
|
-
import { WebSocketChannel } from '../../../common/messaging/web-socket-channel';
|
|
20
|
-
import { Disposable } from '../../../common/disposable';
|
|
21
19
|
import { AddressInfo } from 'net';
|
|
22
|
-
import { io } from 'socket.io-client';
|
|
20
|
+
import { io, Socket } from 'socket.io-client';
|
|
21
|
+
import { Channel, ChannelMultiplexer } from '../../../common/message-rpc/channel';
|
|
22
|
+
import { IWebSocket, WebSocketChannel } from '../../../common/messaging/web-socket-channel';
|
|
23
23
|
|
|
24
|
-
export class
|
|
24
|
+
export class TestWebSocketChannelSetup {
|
|
25
|
+
public readonly multiplexer: ChannelMultiplexer;
|
|
26
|
+
public readonly channel: Channel;
|
|
25
27
|
|
|
26
28
|
constructor({ server, path }: {
|
|
27
29
|
server: http.Server | https.Server,
|
|
28
30
|
path: string
|
|
29
31
|
}) {
|
|
30
|
-
super(0, content => socket.send(content));
|
|
31
32
|
const socket = io(`ws://localhost:${(server.address() as AddressInfo).port}${WebSocketChannel.wsPath}`);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
this.fireClose(0, reason)
|
|
37
|
-
);
|
|
38
|
-
socket.on('message', data => {
|
|
39
|
-
this.handleMessage(JSON.parse(data.toString()));
|
|
33
|
+
this.channel = new WebSocketChannel(toIWebSocket(socket));
|
|
34
|
+
this.multiplexer = new ChannelMultiplexer(this.channel);
|
|
35
|
+
socket.on('connect', () => {
|
|
36
|
+
this.multiplexer.open(path);
|
|
40
37
|
});
|
|
41
|
-
socket.
|
|
42
|
-
this.open(path)
|
|
43
|
-
);
|
|
44
|
-
this.toDispose.push(Disposable.create(() => socket.close()));
|
|
38
|
+
socket.connect();
|
|
45
39
|
}
|
|
40
|
+
}
|
|
46
41
|
|
|
42
|
+
function toIWebSocket(socket: Socket): IWebSocket {
|
|
43
|
+
return {
|
|
44
|
+
close: () => {
|
|
45
|
+
socket.removeAllListeners('disconnect');
|
|
46
|
+
socket.removeAllListeners('error');
|
|
47
|
+
socket.removeAllListeners('message');
|
|
48
|
+
socket.close();
|
|
49
|
+
},
|
|
50
|
+
isConnected: () => socket.connected,
|
|
51
|
+
onClose: cb => socket.on('disconnect', reason => cb(reason)),
|
|
52
|
+
onError: cb => socket.on('error', reason => cb(reason)),
|
|
53
|
+
onMessage: cb => socket.on('message', data => cb(data)),
|
|
54
|
+
send: message => socket.emit('message', message)
|
|
55
|
+
};
|
|
47
56
|
}
|
|
@@ -40,7 +40,7 @@ export class ProxyCliContribution implements CliContribution {
|
|
|
40
40
|
type: 'string'
|
|
41
41
|
});
|
|
42
42
|
conf.option(StrictSSL, {
|
|
43
|
-
description: '
|
|
43
|
+
description: 'Determines whether SSL is strictly set for outgoing requests.',
|
|
44
44
|
type: 'boolean'
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { JSONValue } from '@phosphor/coreutils';
|
|
2
|
-
import { InjectablePreferenceProxy } from './injectable-preference-proxy';
|
|
3
|
-
import { OverridePreferenceName } from './preference-language-override-service';
|
|
4
|
-
import { PreferenceChanges } from './preference-service';
|
|
5
|
-
import { PreferenceValidationService } from './preference-validation-service';
|
|
6
|
-
export declare class ValidatedPreferenceProxy<T extends Record<string, JSONValue>> extends InjectablePreferenceProxy<T> {
|
|
7
|
-
protected readonly validator: PreferenceValidationService;
|
|
8
|
-
/**
|
|
9
|
-
* This map should be initialized only when the proxy starts listening to events from the PreferenceService in {@link ValidatedPreferenceProxy.subscribeToChangeEvents}.
|
|
10
|
-
* Otherwise, it can't guarantee that the cache will remain up-to-date and is better off just retrieving the value.
|
|
11
|
-
*/
|
|
12
|
-
protected validPreferences?: Map<string, JSONValue>;
|
|
13
|
-
protected handlePreferenceChanges(changes: PreferenceChanges): void;
|
|
14
|
-
getValue<K extends keyof T & string>(preferenceIdentifier: K | (OverridePreferenceName & {
|
|
15
|
-
preferenceName: K;
|
|
16
|
-
}), defaultValue: T[K], resourceUri?: string | undefined): T[K];
|
|
17
|
-
protected ensureValid<K extends keyof T & string>(preferenceName: K, getCandidate: () => T[K], isChange?: boolean): T[K];
|
|
18
|
-
protected subscribeToChangeEvents(): void;
|
|
19
|
-
dispose(): void;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=validated-preference-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validated-preference-proxy.d.ts","sourceRoot":"","sources":["../../../src/browser/preferences/validated-preference-proxy.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,qBACa,wBAAwB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAE,SAAQ,yBAAyB,CAAC,CAAC,CAAC;IACtE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAE/F;;;OAGG;IACH,SAAS,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;cAEjC,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAgDnE,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACxC,oBAAoB,EAAE,CAAC,GAAG,CAAC,sBAAsB,GAAG;QAAE,cAAc,EAAE,CAAC,CAAC;KAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,qBAAmB,GAChI,CAAC,CAAC,CAAC,CAAC;IAKP,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,cAAc,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;cAUrG,uBAAuB,IAAI,IAAI;IAKzC,OAAO,IAAI,IAAI;CAM3B"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Ericsson 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
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.ValidatedPreferenceProxy = void 0;
|
|
28
|
-
const inversify_1 = require("inversify");
|
|
29
|
-
const injectable_preference_proxy_1 = require("./injectable-preference-proxy");
|
|
30
|
-
const preference_language_override_service_1 = require("./preference-language-override-service");
|
|
31
|
-
const preference_provider_1 = require("./preference-provider");
|
|
32
|
-
const preference_validation_service_1 = require("./preference-validation-service");
|
|
33
|
-
let ValidatedPreferenceProxy = class ValidatedPreferenceProxy extends injectable_preference_proxy_1.InjectablePreferenceProxy {
|
|
34
|
-
handlePreferenceChanges(changes) {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
if (this.schema) {
|
|
37
|
-
;
|
|
38
|
-
const overrideTracker = new Map();
|
|
39
|
-
for (const change of Object.values(changes)) {
|
|
40
|
-
const overridden = this.preferences.overriddenPreferenceName(change.preferenceName);
|
|
41
|
-
if (this.isRelevantChange(change, overridden)) {
|
|
42
|
-
let doSet = false;
|
|
43
|
-
const baseName = (_a = overridden === null || overridden === void 0 ? void 0 : overridden.preferenceName) !== null && _a !== void 0 ? _a : change.preferenceName;
|
|
44
|
-
const tracker = (_b = overrideTracker.get(baseName)) !== null && _b !== void 0 ? _b : (doSet = true, { overrides: [] });
|
|
45
|
-
if (overridden) {
|
|
46
|
-
tracker.overrides.push(overridden);
|
|
47
|
-
}
|
|
48
|
-
if (doSet) {
|
|
49
|
-
overrideTracker.set(baseName, tracker);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
for (const [baseName, tracker] of overrideTracker.entries()) {
|
|
54
|
-
const validated = [];
|
|
55
|
-
// This could go wrong if someone sets a lot of different, complex values for different language overrides simultaneously.
|
|
56
|
-
// In the normal case, we'll just be doing strict equal checks on primitives.
|
|
57
|
-
const getValidValue = (name) => {
|
|
58
|
-
var _a;
|
|
59
|
-
const configuredForCurrent = changes[name].newValue;
|
|
60
|
-
const existingValue = validated.find(([configuredForValid]) => preference_provider_1.PreferenceProvider.deepEqual(configuredForValid, configuredForCurrent));
|
|
61
|
-
if (existingValue) {
|
|
62
|
-
(_a = this.validPreferences) === null || _a === void 0 ? void 0 : _a.set(name, existingValue[1]);
|
|
63
|
-
return existingValue[1];
|
|
64
|
-
}
|
|
65
|
-
const validValue = this.ensureValid(name, () => configuredForCurrent, true);
|
|
66
|
-
validated.push([configuredForCurrent, validValue]);
|
|
67
|
-
return validValue;
|
|
68
|
-
};
|
|
69
|
-
if (baseName in changes && this.isRelevantChange(changes[baseName])) {
|
|
70
|
-
const newValue = getValidValue(baseName);
|
|
71
|
-
const { domain, oldValue, preferenceName, scope } = changes[baseName];
|
|
72
|
-
this.fireChangeEvent(this.buildNewChangeEvent({ domain, oldValue, preferenceName, scope, newValue }));
|
|
73
|
-
}
|
|
74
|
-
for (const override of tracker.overrides) {
|
|
75
|
-
const name = this.preferences.overridePreferenceName(override);
|
|
76
|
-
const { domain, oldValue, preferenceName, scope } = changes[name];
|
|
77
|
-
const newValue = getValidValue(name);
|
|
78
|
-
this.fireChangeEvent(this.buildNewChangeEvent({ domain, oldValue, preferenceName, scope, newValue }, override));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
getValue(preferenceIdentifier, defaultValue, resourceUri = this.resourceUri) {
|
|
84
|
-
const preferenceName = preference_language_override_service_1.OverridePreferenceName.is(preferenceIdentifier) ? this.preferences.overridePreferenceName(preferenceIdentifier) : preferenceIdentifier;
|
|
85
|
-
return this.ensureValid(preferenceName, () => { var _a; return ((_a = super.getValue(preferenceIdentifier, defaultValue, resourceUri)) !== null && _a !== void 0 ? _a : defaultValue); }, false);
|
|
86
|
-
}
|
|
87
|
-
ensureValid(preferenceName, getCandidate, isChange) {
|
|
88
|
-
var _a, _b;
|
|
89
|
-
if (!isChange && ((_a = this.validPreferences) === null || _a === void 0 ? void 0 : _a.has(preferenceName))) {
|
|
90
|
-
return this.validPreferences.get(preferenceName);
|
|
91
|
-
}
|
|
92
|
-
const candidate = getCandidate();
|
|
93
|
-
const valid = this.validator.validateByName(preferenceName, candidate);
|
|
94
|
-
(_b = this.validPreferences) === null || _b === void 0 ? void 0 : _b.set(preferenceName, valid);
|
|
95
|
-
return valid;
|
|
96
|
-
}
|
|
97
|
-
subscribeToChangeEvents() {
|
|
98
|
-
var _a;
|
|
99
|
-
(_a = this.validPreferences) !== null && _a !== void 0 ? _a : (this.validPreferences = new Map());
|
|
100
|
-
super.subscribeToChangeEvents();
|
|
101
|
-
}
|
|
102
|
-
dispose() {
|
|
103
|
-
var _a;
|
|
104
|
-
super.dispose();
|
|
105
|
-
if (this.options.isDisposable) {
|
|
106
|
-
(_a = this.validPreferences) === null || _a === void 0 ? void 0 : _a.clear();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, inversify_1.inject)(preference_validation_service_1.PreferenceValidationService),
|
|
112
|
-
__metadata("design:type", preference_validation_service_1.PreferenceValidationService)
|
|
113
|
-
], ValidatedPreferenceProxy.prototype, "validator", void 0);
|
|
114
|
-
ValidatedPreferenceProxy = __decorate([
|
|
115
|
-
(0, inversify_1.injectable)()
|
|
116
|
-
], ValidatedPreferenceProxy);
|
|
117
|
-
exports.ValidatedPreferenceProxy = ValidatedPreferenceProxy;
|
|
118
|
-
//# sourceMappingURL=validated-preference-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validated-preference-proxy.js","sourceRoot":"","sources":["../../../src/browser/preferences/validated-preference-proxy.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Logger } from 'vscode-ws-jsonrpc';
|
|
2
|
-
export declare class ConsoleLogger implements Logger {
|
|
3
|
-
error(message: string): void;
|
|
4
|
-
warn(message: string): void;
|
|
5
|
-
info(message: string): void;
|
|
6
|
-
log(message: string): void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/node/messaging/logger.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,qBAAa,aAAc,YAAW,MAAM;IAExC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAI7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/node/messaging/logger.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;;;AAIhF,MAAa,aAAa;IAEtB,KAAK,CAAC,OAAe;QACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,GAAG,CAAC,OAAe;QACf,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CAEJ;AAlBD,sCAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'vscode-ws-jsonrpc';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('vscode-ws-jsonrpc');
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 Ericsson and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { JSONValue } from '@phosphor/coreutils';
|
|
18
|
-
import { inject, injectable } from 'inversify';
|
|
19
|
-
import { InjectablePreferenceProxy } from './injectable-preference-proxy';
|
|
20
|
-
import { OverridePreferenceName } from './preference-language-override-service';
|
|
21
|
-
import { PreferenceProvider } from './preference-provider';
|
|
22
|
-
import { PreferenceChanges } from './preference-service';
|
|
23
|
-
import { PreferenceValidationService } from './preference-validation-service';
|
|
24
|
-
|
|
25
|
-
@injectable()
|
|
26
|
-
export class ValidatedPreferenceProxy<T extends Record<string, JSONValue>> extends InjectablePreferenceProxy<T> {
|
|
27
|
-
@inject(PreferenceValidationService) protected readonly validator: PreferenceValidationService;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* This map should be initialized only when the proxy starts listening to events from the PreferenceService in {@link ValidatedPreferenceProxy.subscribeToChangeEvents}.
|
|
31
|
-
* Otherwise, it can't guarantee that the cache will remain up-to-date and is better off just retrieving the value.
|
|
32
|
-
*/
|
|
33
|
-
protected validPreferences?: Map<string, JSONValue>;
|
|
34
|
-
|
|
35
|
-
protected override handlePreferenceChanges(changes: PreferenceChanges): void {
|
|
36
|
-
if (this.schema) {
|
|
37
|
-
interface TrackedOverrides { overrides: OverridePreferenceName[] };
|
|
38
|
-
const overrideTracker: Map<string, TrackedOverrides> = new Map();
|
|
39
|
-
for (const change of Object.values(changes)) {
|
|
40
|
-
const overridden = this.preferences.overriddenPreferenceName(change.preferenceName);
|
|
41
|
-
if (this.isRelevantChange(change, overridden)) {
|
|
42
|
-
let doSet = false;
|
|
43
|
-
const baseName = overridden?.preferenceName ?? change.preferenceName;
|
|
44
|
-
const tracker: TrackedOverrides = overrideTracker.get(baseName) ?? (doSet = true, { overrides: [] });
|
|
45
|
-
if (overridden) {
|
|
46
|
-
tracker.overrides.push(overridden);
|
|
47
|
-
}
|
|
48
|
-
if (doSet) {
|
|
49
|
-
overrideTracker.set(baseName, tracker);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
for (const [baseName, tracker] of overrideTracker.entries()) {
|
|
54
|
-
const validated: Array<[JSONValue, JSONValue]> = [];
|
|
55
|
-
// This could go wrong if someone sets a lot of different, complex values for different language overrides simultaneously.
|
|
56
|
-
// In the normal case, we'll just be doing strict equal checks on primitives.
|
|
57
|
-
const getValidValue = (name: string): JSONValue => {
|
|
58
|
-
const configuredForCurrent = changes[name].newValue;
|
|
59
|
-
const existingValue = validated.find(([configuredForValid]) => PreferenceProvider.deepEqual(configuredForValid, configuredForCurrent));
|
|
60
|
-
if (existingValue) {
|
|
61
|
-
this.validPreferences?.set(name, existingValue[1]);
|
|
62
|
-
return existingValue[1];
|
|
63
|
-
}
|
|
64
|
-
const validValue = this.ensureValid(name, () => configuredForCurrent, true);
|
|
65
|
-
validated.push([configuredForCurrent, validValue]);
|
|
66
|
-
return validValue;
|
|
67
|
-
};
|
|
68
|
-
if (baseName in changes && this.isRelevantChange(changes[baseName])) {
|
|
69
|
-
const newValue = getValidValue(baseName);
|
|
70
|
-
const { domain, oldValue, preferenceName, scope } = changes[baseName];
|
|
71
|
-
this.fireChangeEvent(this.buildNewChangeEvent({ domain, oldValue, preferenceName, scope, newValue }));
|
|
72
|
-
}
|
|
73
|
-
for (const override of tracker.overrides) {
|
|
74
|
-
const name = this.preferences.overridePreferenceName(override);
|
|
75
|
-
const { domain, oldValue, preferenceName, scope } = changes[name];
|
|
76
|
-
const newValue = getValidValue(name);
|
|
77
|
-
this.fireChangeEvent(this.buildNewChangeEvent({ domain, oldValue, preferenceName, scope, newValue }, override));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
override getValue<K extends keyof T & string>(
|
|
84
|
-
preferenceIdentifier: K | (OverridePreferenceName & { preferenceName: K; }), defaultValue: T[K], resourceUri = this.resourceUri
|
|
85
|
-
): T[K] {
|
|
86
|
-
const preferenceName = OverridePreferenceName.is(preferenceIdentifier) ? this.preferences.overridePreferenceName(preferenceIdentifier) : preferenceIdentifier as string;
|
|
87
|
-
return this.ensureValid(preferenceName, () => (super.getValue(preferenceIdentifier, defaultValue, resourceUri) ?? defaultValue), false) as T[K];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
protected ensureValid<K extends keyof T & string>(preferenceName: K, getCandidate: () => T[K], isChange?: boolean): T[K] {
|
|
91
|
-
if (!isChange && this.validPreferences?.has(preferenceName)) {
|
|
92
|
-
return this.validPreferences.get(preferenceName) as T[K];
|
|
93
|
-
}
|
|
94
|
-
const candidate = getCandidate();
|
|
95
|
-
const valid = this.validator.validateByName(preferenceName, candidate) as T[K];
|
|
96
|
-
this.validPreferences?.set(preferenceName, valid);
|
|
97
|
-
return valid;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
protected override subscribeToChangeEvents(): void {
|
|
101
|
-
this.validPreferences ??= new Map();
|
|
102
|
-
super.subscribeToChangeEvents();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
override dispose(): void {
|
|
106
|
-
super.dispose();
|
|
107
|
-
if (this.options.isDisposable) {
|
|
108
|
-
this.validPreferences?.clear();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|