@theia/core 1.77.0-next.7 → 1.77.0-next.71
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 +5 -5
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js +1 -1
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js.map +1 -1
- package/lib/browser/catalog.json +304 -18
- package/lib/browser/color-application-contribution.d.ts +7 -1
- package/lib/browser/color-application-contribution.d.ts.map +1 -1
- package/lib/browser/color-application-contribution.js +15 -4
- package/lib/browser/color-application-contribution.js.map +1 -1
- package/lib/browser/color-application-contribution.spec.d.ts +2 -0
- package/lib/browser/color-application-contribution.spec.d.ts.map +1 -0
- package/lib/browser/color-application-contribution.spec.js +96 -0
- package/lib/browser/color-application-contribution.spec.js.map +1 -0
- package/lib/browser/color-registry.d.ts +7 -1
- package/lib/browser/color-registry.d.ts.map +1 -1
- package/lib/browser/color-registry.js +12 -0
- package/lib/browser/color-registry.js.map +1 -1
- package/lib/browser/common-commands.d.ts +3 -0
- package/lib/browser/common-commands.d.ts.map +1 -1
- package/lib/browser/common-commands.js +15 -0
- package/lib/browser/common-commands.js.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +8 -1
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +47 -3
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/common-frontend-contribution.spec.js +2 -1
- package/lib/browser/common-frontend-contribution.spec.js.map +1 -1
- package/lib/browser/components/card.d.ts +1 -1
- package/lib/browser/components/card.d.ts.map +1 -1
- package/lib/browser/components/card.js +3 -2
- package/lib/browser/components/card.js.map +1 -1
- package/lib/browser/connection-status-service.spec.js +2 -1
- package/lib/browser/connection-status-service.spec.js.map +1 -1
- package/lib/browser/context-key-service.d.ts +11 -0
- package/lib/browser/context-key-service.d.ts.map +1 -1
- package/lib/browser/context-key-service.js +7 -0
- package/lib/browser/context-key-service.js.map +1 -1
- package/lib/browser/decorations-service.spec.js +2 -1
- package/lib/browser/decorations-service.spec.js.map +1 -1
- package/lib/browser/dialogs/react-dialog.spec.js +2 -1
- package/lib/browser/dialogs/react-dialog.spec.js.map +1 -1
- package/lib/browser/diff-uris.js +1 -1
- package/lib/browser/diff-uris.js.map +1 -1
- package/lib/browser/endpoint.js +2 -1
- package/lib/browser/endpoint.js.map +1 -1
- package/lib/browser/endpoint.spec.js +2 -1
- package/lib/browser/endpoint.spec.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +3 -0
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/keybinding.d.ts +95 -17
- package/lib/browser/keybinding.d.ts.map +1 -1
- package/lib/browser/keybinding.js +406 -76
- package/lib/browser/keybinding.js.map +1 -1
- package/lib/browser/keybinding.spec.js +804 -33
- package/lib/browser/keybinding.spec.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +3 -4
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js +3 -3
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +42 -3
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.d.ts +67 -15
- package/lib/browser/keyboard/keyboard-layout-service.d.ts.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.js +313 -98
- package/lib/browser/keyboard/keyboard-layout-service.js.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.spec.js +570 -15
- package/lib/browser/keyboard/keyboard-layout-service.spec.js.map +1 -1
- package/lib/browser/keyboard/keys.spec.js +187 -3
- package/lib/browser/keyboard/keys.spec.js.map +1 -1
- package/lib/browser/label-provider.d.ts.map +1 -1
- package/lib/browser/label-provider.js +5 -3
- package/lib/browser/label-provider.js.map +1 -1
- package/lib/browser/label-provider.spec.js +2 -1
- package/lib/browser/label-provider.spec.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js +2 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.js +4 -4
- package/lib/browser/markdown-rendering/markdown-renderer.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown.js +2 -1
- package/lib/browser/markdown-rendering/markdown.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown.spec.js +2 -1
- package/lib/browser/markdown-rendering/markdown.spec.js.map +1 -1
- package/lib/browser/menu/action-menu-node.d.ts +5 -3
- package/lib/browser/menu/action-menu-node.d.ts.map +1 -1
- package/lib/browser/menu/action-menu-node.js +2 -11
- package/lib/browser/menu/action-menu-node.js.map +1 -1
- package/lib/browser/menu/action-menu-node.spec.d.ts +2 -0
- package/lib/browser/menu/action-menu-node.spec.d.ts.map +1 -0
- package/lib/browser/menu/action-menu-node.spec.js +54 -0
- package/lib/browser/menu/action-menu-node.spec.js.map +1 -0
- package/lib/browser/menu/browser-menu-plugin.js +1 -1
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/menu/menu.spec.js +2 -1
- package/lib/browser/menu/menu.spec.js.map +1 -1
- package/lib/browser/opener-service.spec.js +3 -2
- package/lib/browser/opener-service.spec.js.map +1 -1
- package/lib/browser/perspective-service.spec.js +2 -1
- package/lib/browser/perspective-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-proxy.spec.js +2 -1
- package/lib/browser/preferences/preference-proxy.spec.js.map +1 -1
- package/lib/browser/preferences/preference-schema-provider.spec.js +2 -1
- package/lib/browser/preferences/preference-schema-provider.spec.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +2 -1
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-validation-service.spec.js +78 -77
- package/lib/browser/preferences/preference-validation-service.spec.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.d.ts +10 -1
- package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +31 -6
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.spec.d.ts +2 -0
- package/lib/browser/quick-input/quick-command-service.spec.d.ts.map +1 -0
- package/lib/browser/quick-input/quick-command-service.spec.js +130 -0
- package/lib/browser/quick-input/quick-command-service.spec.js.map +1 -0
- package/lib/browser/quick-input/quick-help-service.js +1 -1
- package/lib/browser/quick-input/quick-help-service.js.map +1 -1
- package/lib/browser/quick-input/quick-input-service.spec.js +2 -1
- package/lib/browser/quick-input/quick-input-service.spec.js.map +1 -1
- package/lib/browser/quick-input/quick-pick-service-impl.d.ts +6 -6
- package/lib/browser/quick-input/quick-pick-service-impl.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-view-service.spec.js +2 -1
- package/lib/browser/quick-input/quick-view-service.spec.js.map +1 -1
- package/lib/browser/secondary-window-handler.d.ts +4 -4
- package/lib/browser/secondary-window-handler.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +1 -1
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/application-shell.spec.js +2 -1
- package/lib/browser/shell/application-shell.spec.js.map +1 -1
- package/lib/browser/shell/index.d.ts +1 -0
- package/lib/browser/shell/index.d.ts.map +1 -1
- package/lib/browser/shell/index.js +1 -0
- package/lib/browser/shell/index.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 +6 -0
- package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.spec.js +9 -1
- package/lib/browser/shell/shell-layout-restorer.spec.js.map +1 -1
- package/lib/browser/shell/side-panel-handler.d.ts +12 -1
- package/lib/browser/shell/side-panel-handler.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-handler.js +73 -0
- package/lib/browser/shell/side-panel-handler.js.map +1 -1
- package/lib/browser/shell/side-panel-handler.spec.d.ts +2 -0
- package/lib/browser/shell/side-panel-handler.spec.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-handler.spec.js +85 -0
- package/lib/browser/shell/side-panel-handler.spec.js.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.d.ts +55 -0
- package/lib/browser/shell/side-panel-item-visibility.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.js +100 -0
- package/lib/browser/shell/side-panel-item-visibility.js.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.d.ts +2 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.js +80 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.js.map +1 -0
- package/lib/browser/shell/side-panel-toolbar.d.ts +1 -1
- package/lib/browser/shell/side-panel-toolbar.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.spec.js +2 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.spec.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +17 -0
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +33 -15
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/shell/tab-bars.spec.js +86 -0
- package/lib/browser/shell/tab-bars.spec.js.map +1 -1
- package/lib/browser/status-bar/status-bar.js +1 -1
- package/lib/browser/status-bar/status-bar.js.map +1 -1
- package/lib/browser/storage-service.spec.js +2 -1
- package/lib/browser/storage-service.spec.js.map +1 -1
- package/lib/browser/test/jsdom.d.ts.map +1 -1
- package/lib/browser/test/jsdom.js +11 -0
- package/lib/browser/test/jsdom.js.map +1 -1
- package/lib/browser/tooltip-service.js +1 -1
- package/lib/browser/tooltip-service.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts +2 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.js +6 -2
- package/lib/browser/tree/tree-compression/compressed-tree-model.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.d.ts +2 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.d.ts.map +1 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.js +52 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.js.map +1 -0
- package/lib/browser/tree/tree-consistency.spec.js +1 -1
- package/lib/browser/tree/tree-consistency.spec.js.map +1 -1
- package/lib/browser/tree/tree-container.spec.js +6 -5
- package/lib/browser/tree/tree-container.spec.js.map +1 -1
- package/lib/browser/tree/tree-iterator.js +1 -1
- package/lib/browser/tree/tree-iterator.js.map +1 -1
- package/lib/browser/tree/tree-model.js +2 -2
- package/lib/browser/tree/tree-model.js.map +1 -1
- package/lib/browser/tree/tree-selection-state.d.ts +23 -1
- package/lib/browser/tree/tree-selection-state.d.ts.map +1 -1
- package/lib/browser/tree/tree-selection-state.js +23 -1
- package/lib/browser/tree/tree-selection-state.js.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget.d.ts +2 -2
- package/lib/browser/tree/tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +3 -4
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget.spec.js +18 -0
- package/lib/browser/tree/tree-widget.spec.js.map +1 -1
- package/lib/browser/tree/tree.spec.js +2 -1
- package/lib/browser/tree/tree.spec.js.map +1 -1
- package/lib/browser/user-working-directory-provider.js +1 -1
- package/lib/browser/user-working-directory-provider.js.map +1 -1
- package/lib/browser/view-container.d.ts.map +1 -1
- package/lib/browser/view-container.js +2 -1
- package/lib/browser/view-container.js.map +1 -1
- package/lib/browser/widgets/react-renderer.js +1 -1
- package/lib/browser/widgets/react-renderer.js.map +1 -1
- package/lib/browser/widgets/react-widget.js +1 -1
- package/lib/browser/widgets/react-widget.js.map +1 -1
- package/lib/browser/widgets/select-component.d.ts.map +1 -1
- package/lib/browser/widgets/select-component.js +10 -14
- package/lib/browser/widgets/select-component.js.map +1 -1
- package/lib/browser/widgets/select-component.spec.d.ts +2 -0
- package/lib/browser/widgets/select-component.spec.d.ts.map +1 -0
- package/lib/browser/widgets/select-component.spec.js +67 -0
- package/lib/browser/widgets/select-component.spec.js.map +1 -0
- package/lib/browser/widgets/widget.js +1 -1
- package/lib/browser/widgets/widget.js.map +1 -1
- package/lib/common/buffer.js +3 -2
- package/lib/common/buffer.js.map +1 -1
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/command.spec.js +2 -1
- package/lib/common/command.spec.js.map +1 -1
- package/lib/common/core-preferences.js +5 -5
- package/lib/common/core-preferences.js.map +1 -1
- package/lib/common/disposable.spec.js +3 -2
- package/lib/common/disposable.spec.js.map +1 -1
- package/lib/common/encoding-service.js +2 -2
- package/lib/common/encoding-service.js.map +1 -1
- package/lib/common/event.d.ts +1 -1
- package/lib/common/event.d.ts.map +1 -1
- package/lib/common/event.js +0 -1
- package/lib/common/event.js.map +1 -1
- package/lib/common/file-uri.js +2 -1
- package/lib/common/file-uri.js.map +1 -1
- package/lib/common/fuzzy-search.js +1 -1
- package/lib/common/fuzzy-search.js.map +1 -1
- package/lib/common/glob.d.ts.map +1 -1
- package/lib/common/glob.js +9 -15
- package/lib/common/glob.js.map +1 -1
- package/lib/common/index.js +1 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/keyboard/keyboard-layout-provider.d.ts +7 -0
- package/lib/common/keyboard/keyboard-layout-provider.d.ts.map +1 -1
- package/lib/common/keyboard/keyboard-layout-provider.js.map +1 -1
- package/lib/common/keys.d.ts +86 -3
- package/lib/common/keys.d.ts.map +1 -1
- package/lib/common/keys.js +263 -24
- package/lib/common/keys.js.map +1 -1
- package/lib/common/message-rpc/channel.spec.js +3 -2
- package/lib/common/message-rpc/channel.spec.js.map +1 -1
- package/lib/common/messaging/proxy-factory.js +2 -2
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/messaging/proxy-factory.spec.js +2 -1
- package/lib/common/messaging/proxy-factory.spec.js.map +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts.map +1 -1
- package/lib/common/path.spec.js +2 -1
- package/lib/common/path.spec.js.map +1 -1
- package/lib/common/performance/stopwatch.spec.js +2 -1
- package/lib/common/performance/stopwatch.spec.js.map +1 -1
- package/lib/common/preferences/preference-schema-service.d.ts +2 -2
- package/lib/common/preferences/preference-schema-service.d.ts.map +1 -1
- package/lib/common/preferences/preference-service.js +1 -1
- package/lib/common/preferences/preference-service.js.map +1 -1
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js +5 -2
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/promise-util.spec.js +17 -1
- package/lib/common/promise-util.spec.js.map +1 -1
- package/lib/common/quick-pick-service.d.ts +5 -0
- package/lib/common/quick-pick-service.d.ts.map +1 -1
- package/lib/common/quick-pick-service.js +2 -1
- package/lib/common/quick-pick-service.js.map +1 -1
- package/lib/common/reference.spec.js +2 -1
- package/lib/common/reference.spec.js.map +1 -1
- package/lib/common/resource.js +1 -1
- package/lib/common/resource.js.map +1 -1
- package/lib/common/selection-service.spec.js +2 -1
- package/lib/common/selection-service.spec.js.map +1 -1
- package/lib/common/selection.js +2 -1
- package/lib/common/selection.js.map +1 -1
- package/lib/common/stream.d.ts.map +1 -1
- package/lib/common/stream.js +2 -1
- package/lib/common/stream.js.map +1 -1
- package/lib/common/strings.d.ts.map +1 -1
- package/lib/common/strings.js +1 -2
- package/lib/common/strings.js.map +1 -1
- package/lib/common/ternary-search-tree.js +2 -2
- package/lib/common/ternary-search-tree.js.map +1 -1
- package/lib/common/ternary-search-tree.spec.js +12 -0
- package/lib/common/ternary-search-tree.spec.js.map +1 -1
- package/lib/common/test/mock-resource-provider.js +1 -1
- package/lib/common/test/mock-resource-provider.js.map +1 -1
- package/lib/common/types.spec.js +2 -1
- package/lib/common/types.spec.js.map +1 -1
- package/lib/common/uri-command-handler.js +4 -3
- package/lib/common/uri-command-handler.js.map +1 -1
- package/lib/common/uri-command-handler.spec.js +3 -2
- package/lib/common/uri-command-handler.spec.js.map +1 -1
- package/lib/common/uri.spec.js +3 -2
- package/lib/common/uri.spec.js.map +1 -1
- package/lib/electron-browser/electron-clipboard-service.d.ts +1 -1
- package/lib/electron-browser/electron-clipboard-service.d.ts.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.d.ts +2 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.d.ts.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js +8 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.d.ts +2 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.d.ts.map +1 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.js +28 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.js.map +1 -0
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.js +3 -2
- package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +3 -0
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/preload.js +1 -1
- package/lib/electron-browser/preload.js.map +1 -1
- package/lib/electron-browser/window/window-zoom-action-bar.js +2 -1
- package/lib/electron-browser/window/window-zoom-action-bar.js.map +1 -1
- package/lib/electron-common/electron-api.d.ts +6 -1
- package/lib/electron-common/electron-api.d.ts.map +1 -1
- package/lib/electron-common/electron-api.js +21 -0
- package/lib/electron-common/electron-api.js.map +1 -1
- package/lib/electron-common/electron-api.spec.d.ts +2 -0
- package/lib/electron-common/electron-api.spec.d.ts.map +1 -0
- package/lib/electron-common/electron-api.spec.js +40 -0
- package/lib/electron-common/electron-api.spec.js.map +1 -0
- package/lib/electron-main/electron-api-main.d.ts +0 -1
- package/lib/electron-main/electron-api-main.d.ts.map +1 -1
- package/lib/electron-main/electron-api-main.js +8 -18
- package/lib/electron-main/electron-api-main.js.map +1 -1
- package/lib/electron-main/electron-main-application.js +2 -2
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/electron-node/hosting/electron-backend-hosting-module.spec.js +2 -1
- package/lib/electron-node/hosting/electron-backend-hosting-module.spec.js.map +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js.map +1 -1
- package/lib/electron-node/token/electron-token-validator.js +2 -2
- package/lib/electron-node/token/electron-token-validator.js.map +1 -1
- package/lib/node/backend-application.d.ts +11 -5
- package/lib/node/backend-application.d.ts.map +1 -1
- package/lib/node/backend-application.js +34 -12
- package/lib/node/backend-application.js.map +1 -1
- package/lib/node/backend-application.spec.js +52 -3
- package/lib/node/backend-application.spec.js.map +1 -1
- package/lib/node/bundled-resource-provider.js +4 -4
- package/lib/node/bundled-resource-provider.js.map +1 -1
- package/lib/node/bundled-resource-provider.spec.js +5 -4
- package/lib/node/bundled-resource-provider.spec.js.map +1 -1
- package/lib/node/cli.d.ts +1 -1
- package/lib/node/cli.d.ts.map +1 -1
- package/lib/node/cli.js +2 -2
- package/lib/node/cli.js.map +1 -1
- package/lib/node/cli.spec.js +3 -2
- package/lib/node/cli.spec.js.map +1 -1
- package/lib/node/console-logger-server.js +1 -1
- package/lib/node/console-logger-server.js.map +1 -1
- package/lib/node/env-variables/env-variables-server.js +1 -1
- package/lib/node/env-variables/env-variables-server.js.map +1 -1
- package/lib/node/environment-utils.spec.js +2 -1
- package/lib/node/environment-utils.spec.js.map +1 -1
- package/lib/node/file-uri.spec.js +4 -3
- package/lib/node/file-uri.spec.js.map +1 -1
- package/lib/node/filesystem-locking.js +1 -1
- package/lib/node/filesystem-locking.js.map +1 -1
- package/lib/node/hosting/browser-connection-token.js +2 -2
- package/lib/node/hosting/browser-connection-token.js.map +1 -1
- package/lib/node/i18n/localization-contribution.js +1 -1
- package/lib/node/i18n/localization-contribution.js.map +1 -1
- package/lib/node/key-store-server.js +1 -1
- package/lib/node/key-store-server.js.map +1 -1
- package/lib/node/logger-cli-contribution.js +2 -2
- package/lib/node/logger-cli-contribution.js.map +1 -1
- package/lib/node/logger-cli-contribution.spec.js +17 -16
- package/lib/node/logger-cli-contribution.spec.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.d.ts.map +1 -1
- package/lib/node/messaging/binary-message-pipe.js +5 -3
- package/lib/node/messaging/binary-message-pipe.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.spec.d.ts +2 -0
- package/lib/node/messaging/binary-message-pipe.spec.d.ts.map +1 -0
- package/lib/node/messaging/binary-message-pipe.spec.js +71 -0
- package/lib/node/messaging/binary-message-pipe.spec.js.map +1 -0
- package/lib/node/messaging/ipc-connection-provider.js +2 -2
- package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
- package/lib/node/process-utils.d.ts +61 -0
- package/lib/node/process-utils.d.ts.map +1 -1
- package/lib/node/process-utils.js +157 -4
- package/lib/node/process-utils.js.map +1 -1
- package/lib/node/process-utils.slow-spec.d.ts +2 -0
- package/lib/node/process-utils.slow-spec.d.ts.map +1 -0
- package/lib/node/process-utils.slow-spec.js +106 -0
- package/lib/node/process-utils.slow-spec.js.map +1 -0
- package/lib/node/process-utils.spec.js +139 -1
- package/lib/node/process-utils.spec.js.map +1 -1
- package/lib/node/request/backend-request-facade.spec.js +2 -1
- package/lib/node/request/backend-request-facade.spec.js.map +1 -1
- package/lib/node/setting-service.spec.js +2 -1
- package/lib/node/setting-service.spec.js.map +1 -1
- package/lib/node/test/exiting-backend.d.ts +18 -0
- package/lib/node/test/exiting-backend.d.ts.map +1 -0
- package/lib/node/test/exiting-backend.js +71 -0
- package/lib/node/test/exiting-backend.js.map +1 -0
- package/package.json +16 -16
- package/src/browser/color-application-contribution.spec.ts +108 -0
- package/src/browser/color-application-contribution.ts +16 -4
- package/src/browser/color-registry.ts +13 -0
- package/src/browser/common-commands.ts +15 -0
- package/src/browser/common-frontend-contribution.ts +46 -2
- package/src/browser/components/card.tsx +1 -1
- package/src/browser/context-key-service.ts +15 -0
- package/src/browser/frontend-application-module.ts +3 -0
- package/src/browser/keybinding.spec.ts +895 -34
- package/src/browser/keybinding.ts +470 -85
- package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +1 -1
- package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +52 -1
- package/src/browser/keyboard/browser-keyboard-layout-provider.ts +5 -5
- package/src/browser/keyboard/keyboard-layout-service.spec.ts +673 -15
- package/src/browser/keyboard/keyboard-layout-service.ts +362 -106
- package/src/browser/keyboard/keys.spec.ts +206 -1
- package/src/browser/label-provider.ts +3 -1
- package/src/browser/markdown-rendering/markdown-renderer.ts +1 -1
- package/src/browser/menu/action-menu-node.spec.ts +60 -0
- package/src/browser/menu/action-menu-node.ts +8 -14
- package/src/browser/menu/browser-menu-plugin.ts +1 -1
- package/src/browser/preferences/preference-validation-service.spec.ts +1 -1
- package/src/browser/quick-input/quick-command-service.spec.ts +159 -0
- package/src/browser/quick-input/quick-command-service.ts +36 -9
- package/src/browser/quick-input/quick-help-service.ts +1 -1
- package/src/browser/shell/index.ts +1 -0
- package/src/browser/shell/shell-layout-restorer.spec.ts +10 -0
- package/src/browser/shell/shell-layout-restorer.ts +5 -0
- package/src/browser/shell/side-panel-handler.spec.ts +94 -0
- package/src/browser/shell/side-panel-handler.ts +75 -1
- package/src/browser/shell/side-panel-item-visibility.spec.ts +91 -0
- package/src/browser/shell/side-panel-item-visibility.ts +115 -0
- package/src/browser/shell/tab-bars.spec.ts +96 -1
- package/src/browser/shell/tab-bars.ts +36 -13
- package/src/browser/style/hover-service.css +0 -2
- package/src/browser/test/jsdom.ts +11 -0
- package/src/browser/tree/tree-compression/compressed-tree-model.spec.ts +57 -0
- package/src/browser/tree/tree-compression/compressed-tree-model.ts +11 -2
- package/src/browser/tree/tree-container.spec.ts +1 -1
- package/src/browser/tree/tree-iterator.ts +1 -1
- package/src/browser/tree/tree-model.ts +2 -2
- package/src/browser/tree/tree-selection-state.ts +40 -1
- package/src/browser/tree/tree-widget.spec.tsx +20 -0
- package/src/browser/tree/tree-widget.tsx +4 -5
- package/src/browser/view-container.ts +2 -1
- package/src/browser/widgets/select-component.spec.ts +77 -0
- package/src/browser/widgets/select-component.tsx +6 -10
- package/src/common/cancellation.ts +1 -1
- package/src/common/core-preferences.ts +5 -5
- package/src/common/disposable.spec.ts +1 -1
- package/src/common/event.ts +1 -2
- package/src/common/glob.ts +13 -30
- package/src/common/json-schema.ts +1 -1
- package/src/common/keyboard/keyboard-layout-provider.ts +8 -0
- package/src/common/keys.ts +312 -27
- package/src/common/message-rpc/channel.spec.ts +1 -1
- package/src/common/messaging/proxy-factory.ts +2 -2
- package/src/common/promise-util.spec.ts +18 -2
- package/src/common/promise-util.ts +5 -2
- package/src/common/quick-pick-service.ts +5 -0
- package/src/common/stream.ts +4 -3
- package/src/common/strings.ts +2 -5
- package/src/common/ternary-search-tree.spec.ts +14 -0
- package/src/common/ternary-search-tree.ts +3 -3
- package/src/common/uri-command-handler.ts +2 -2
- package/src/electron-browser/electron-clipboard-service.ts +1 -1
- package/src/electron-browser/keyboard/electron-keyboard-module.spec.ts +29 -0
- package/src/electron-browser/keyboard/electron-keyboard-module.ts +9 -2
- package/src/electron-browser/menu/electron-main-menu-factory.ts +3 -3
- package/src/electron-browser/menu/electron-menu-contribution.ts +4 -0
- package/src/electron-browser/preload.ts +2 -2
- package/src/electron-common/electron-api.spec.ts +42 -0
- package/src/electron-common/electron-api.ts +24 -1
- package/src/electron-main/electron-api-main.ts +7 -17
- package/src/node/backend-application.spec.ts +68 -2
- package/src/node/backend-application.ts +28 -6
- package/src/node/cli.ts +1 -1
- package/src/node/logger-cli-contribution.spec.ts +1 -1
- package/src/node/messaging/binary-message-pipe.spec.ts +81 -0
- package/src/node/messaging/binary-message-pipe.ts +5 -4
- package/src/node/process-utils.slow-spec.ts +122 -0
- package/src/node/process-utils.spec.ts +162 -0
- package/src/node/process-utils.ts +166 -3
- package/src/node/test/exiting-backend.ts +75 -0
|
@@ -15,20 +15,31 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject, optional } from 'inversify';
|
|
18
|
-
import type { ILinuxKeyMapping, IMacKeyMapping, IWindowsKeyMapping } from 'native-keymap';
|
|
18
|
+
import type { IKeyboardLayoutInfo, ILinuxKeyMapping, IMacKeyMapping, IWindowsKeyMapping } from 'native-keymap';
|
|
19
19
|
import { isOSX, isWindows } from '../../common/os';
|
|
20
20
|
import {
|
|
21
21
|
NativeKeyboardLayout, KeyboardLayoutProvider, KeyboardLayoutChangeNotifier, KeyValidator
|
|
22
22
|
} from '../../common/keyboard/keyboard-layout-provider';
|
|
23
23
|
import { Emitter, Event } from '../../common/event';
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
KeyCode, Key, LayoutModifiers, NormalizedKeyboardInput, isPrintableCharacter, isPrintableKey,
|
|
26
|
+
layoutModifiersIncludeAltGraph, layoutModifiersIncludeShift
|
|
27
|
+
} from './keys';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A physical key and keyboard-layout modifier layer that can produce a logical character.
|
|
31
|
+
*/
|
|
32
|
+
export interface KeyboardLayoutCandidate {
|
|
33
|
+
readonly key: Key;
|
|
34
|
+
readonly character: string;
|
|
35
|
+
readonly layoutModifiers: LayoutModifiers;
|
|
36
|
+
}
|
|
25
37
|
|
|
26
38
|
export interface KeyboardLayout {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly key2KeyCode: KeyCode[];
|
|
39
|
+
readonly candidatesByCharacter: ReadonlyMap<string, readonly KeyboardLayoutCandidate[]>;
|
|
40
|
+
readonly candidatesByFoldedCharacter: ReadonlyMap<string, readonly KeyboardLayoutCandidate[]>;
|
|
41
|
+
/** Physical KeyboardEvent code to the lowercase Latin letter registered as a fallback. */
|
|
42
|
+
readonly latinFallbackByCode: ReadonlyMap<string, string>;
|
|
32
43
|
/**
|
|
33
44
|
* Mapping of KeyboardEvent codes to the characters shown on the user's keyboard
|
|
34
45
|
* for the respective keys.
|
|
@@ -48,11 +59,25 @@ export class KeyboardLayoutService {
|
|
|
48
59
|
@inject(KeyValidator) @optional()
|
|
49
60
|
protected readonly keyValidator?: KeyValidator;
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
// The transformed layout used for logical-character resolution and display.
|
|
63
|
+
protected currentLayout?: KeyboardLayout;
|
|
64
|
+
// The provider's original layout data used to verify characters produced by key events.
|
|
65
|
+
protected currentNativeLayout?: NativeKeyboardLayout;
|
|
66
|
+
protected currentLayoutInfo?: IKeyboardLayoutInfo;
|
|
67
|
+
|
|
68
|
+
get layoutInfo(): IKeyboardLayoutInfo | undefined {
|
|
69
|
+
return this.currentLayoutInfo;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get layoutSource(): string {
|
|
73
|
+
return this.layoutProvider.layoutSource ?? 'unknown';
|
|
74
|
+
}
|
|
52
75
|
|
|
53
76
|
protected updateLayout(newLayout: NativeKeyboardLayout): KeyboardLayout {
|
|
54
77
|
const transformed = this.transformNativeLayout(newLayout);
|
|
55
78
|
this.currentLayout = transformed;
|
|
79
|
+
this.currentNativeLayout = newLayout;
|
|
80
|
+
this.currentLayoutInfo = newLayout.info;
|
|
56
81
|
this.keyboardLayoutChanged.fire(transformed);
|
|
57
82
|
return transformed;
|
|
58
83
|
}
|
|
@@ -70,25 +95,242 @@ export class KeyboardLayoutService {
|
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
/**
|
|
73
|
-
* Resolve
|
|
74
|
-
*
|
|
75
|
-
* key
|
|
98
|
+
* Resolve an authored keybinding stroke against the active layout.
|
|
99
|
+
* Physical and non-printable strokes, and strokes resolved without an active layout, are returned unchanged. Latin letters
|
|
100
|
+
* missing from the active layout resolve to their US key position; any other missing logical character is returned with
|
|
101
|
+
* {@link KeyCode.supportedByLayout} set to `false`. Authored Shift is absorbed when it produces the character (US-key tokens
|
|
102
|
+
* or shift-layer candidates); otherwise it remains a command modifier.
|
|
76
103
|
*/
|
|
77
104
|
resolveKeyCode(inCode: KeyCode): KeyCode {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
105
|
+
if (inCode.physical || !this.currentLayout || inCode.key && !isPrintableKey(inCode.key) && !inCode.character) {
|
|
106
|
+
return inCode;
|
|
107
|
+
}
|
|
108
|
+
const usCharacter = inCode.key ? US_CHARACTER_BY_KEY.get(usCharacterIndex(inCode.key, inCode.shift)) : undefined;
|
|
109
|
+
const character = inCode.character ?? usCharacter ?? inCode.key?.easyString;
|
|
110
|
+
if (!character) {
|
|
111
|
+
return inCode;
|
|
112
|
+
}
|
|
113
|
+
const exactCandidates = this.currentLayout.candidatesByCharacter.get(character);
|
|
114
|
+
const candidate = exactCandidates?.[0] ?? this.currentLayout.candidatesByFoldedCharacter.get(character.toLocaleLowerCase())?.[0];
|
|
115
|
+
if (!candidate) {
|
|
116
|
+
return new KeyCode({
|
|
117
|
+
key: inCode.key,
|
|
118
|
+
meta: inCode.meta,
|
|
119
|
+
ctrl: inCode.ctrl,
|
|
120
|
+
shift: inCode.shift,
|
|
121
|
+
alt: inCode.alt,
|
|
122
|
+
character,
|
|
123
|
+
authoredToken: inCode.authoredToken,
|
|
124
|
+
supportedByLayout: false
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return new KeyCode({
|
|
128
|
+
key: candidate.key,
|
|
129
|
+
meta: inCode.meta,
|
|
130
|
+
ctrl: inCode.ctrl,
|
|
131
|
+
shift: inCode.shift && !usCharacter && !layoutModifiersIncludeShift(candidate.layoutModifiers),
|
|
132
|
+
alt: inCode.alt,
|
|
133
|
+
character,
|
|
134
|
+
layoutModifiers: candidate.layoutModifiers,
|
|
135
|
+
interpretation: 'authored',
|
|
136
|
+
authoredToken: inCode.authoredToken
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Whether the platform's AltGraph layer is active: AltGraph on Linux, Option on macOS, and AltGraph or Ctrl+Alt on Windows.
|
|
142
|
+
*/
|
|
143
|
+
protected isAltGraphActive(input: NormalizedKeyboardInput): boolean {
|
|
144
|
+
return isOSX ? !!input.altKey : isWindows ? !!input.altGraph || !!(input.ctrlKey && input.altKey) : !!input.altGraph;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Detect the keyboard-layout modifier layer that produced an input character.
|
|
149
|
+
* `undefined` means either that no layout modifiers were needed or that the input represents a dead key.
|
|
150
|
+
*/
|
|
151
|
+
detectLayoutModifiers(input: NormalizedKeyboardInput): LayoutModifiers | undefined {
|
|
152
|
+
if (input.isComposing || !input.code || !this.shouldIncludeKey(input.code) || !isPrintableCharacter(input.key)) {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
const mapping = this.getNativeMapping(input.code);
|
|
156
|
+
if (!mapping) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
const altGraphActive = this.isAltGraphActive(input);
|
|
160
|
+
// Caps Lock can invert the case of the produced character, so layers are compared case-insensitively.
|
|
161
|
+
const key = input.key.toLocaleLowerCase();
|
|
162
|
+
const producedBy = (character: string | undefined, isDeadKey: boolean | undefined): boolean =>
|
|
163
|
+
!!character && !isDeadKey && character.toLocaleLowerCase() === key;
|
|
164
|
+
if (input.shiftKey && altGraphActive && producedBy(mapping.withShiftAltGr, mapping.withShiftAltGrIsDeadKey)) {
|
|
165
|
+
return 'shiftAltGraph';
|
|
166
|
+
}
|
|
167
|
+
if (input.shiftKey && altGraphActive && !mapping.withShiftAltGr && producedBy(mapping.withAltGr, mapping.withAltGrIsDeadKey)) {
|
|
168
|
+
return 'shiftAltGraph';
|
|
169
|
+
}
|
|
170
|
+
if (!input.shiftKey && altGraphActive && producedBy(mapping.withAltGr, mapping.withAltGrIsDeadKey)) {
|
|
171
|
+
return 'altGraph';
|
|
172
|
+
}
|
|
173
|
+
if (input.shiftKey && producedBy(mapping.withShift, mapping.withShiftIsDeadKey)) {
|
|
174
|
+
return 'shift';
|
|
175
|
+
}
|
|
176
|
+
// Synthetic input, e.g. from test automation, can report the base character while Shift is held.
|
|
177
|
+
if (input.shiftKey && !altGraphActive && producedBy(mapping.value, mapping.valueIsDeadKey) && !!mapping.withShift && !mapping.withShiftIsDeadKey) {
|
|
178
|
+
return 'shift';
|
|
179
|
+
}
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
protected getNativeMapping(code: string): (ILinuxKeyMapping & Partial<IMacKeyMapping>) | undefined {
|
|
184
|
+
return this.currentNativeLayout?.mapping[code] as (ILinuxKeyMapping & Partial<IMacKeyMapping>) | undefined;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Return the character committed by the detected layout layer, which can differ from the input by case, e.g. because
|
|
189
|
+
* Caps Lock inverted the case of the produced character. Returns `undefined` when the layer character is unknown.
|
|
190
|
+
*/
|
|
191
|
+
protected layerCharacter(input: NormalizedKeyboardInput, layoutModifiers: LayoutModifiers | undefined): string | undefined {
|
|
192
|
+
if (!input.code || !this.shouldIncludeKey(input.code) || !isPrintableCharacter(input.key)) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
const mapping = this.getNativeMapping(input.code);
|
|
196
|
+
if (!mapping) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
if (layoutModifiers === 'shift') {
|
|
200
|
+
return mapping.withShift && !mapping.withShiftIsDeadKey ? mapping.withShift : undefined;
|
|
201
|
+
}
|
|
202
|
+
if (layoutModifiers === 'shiftAltGraph' && mapping.withShiftAltGr) {
|
|
203
|
+
return !mapping.withShiftAltGrIsDeadKey ? mapping.withShiftAltGr : undefined;
|
|
204
|
+
}
|
|
205
|
+
if (layoutModifiers === 'altGraph' || layoutModifiers === 'shiftAltGraph') {
|
|
206
|
+
return mapping.withAltGr && !mapping.withAltGrIsDeadKey ? mapping.withAltGr : undefined;
|
|
207
|
+
}
|
|
208
|
+
if (layoutModifiers === undefined && !input.shiftKey && !this.isAltGraphActive(input) && mapping.value && !mapping.valueIsDeadKey
|
|
209
|
+
&& mapping.value.toLocaleLowerCase() === input.key.toLocaleLowerCase()) {
|
|
210
|
+
return mapping.value;
|
|
211
|
+
}
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Return all command- and layout-modifier interpretations of a normalized keyboard input.
|
|
217
|
+
* The committed character follows the detected layout layer, so Caps Lock does not change the case of the character.
|
|
218
|
+
*/
|
|
219
|
+
getKeyCodeInterpretations(input: NormalizedKeyboardInput, eventDispatch: 'code' | 'keyCode'): KeyCode[] {
|
|
220
|
+
let keyCode = KeyCode.createKeyCode(input, eventDispatch);
|
|
221
|
+
if (eventDispatch === 'keyCode' || keyCode.isModifierOnly()) {
|
|
222
|
+
return [keyCode];
|
|
223
|
+
}
|
|
224
|
+
const layoutModifiers = this.detectLayoutModifiers(input);
|
|
225
|
+
const character = this.layerCharacter(input, layoutModifiers);
|
|
226
|
+
if (character !== undefined && character !== keyCode.character) {
|
|
227
|
+
keyCode = new KeyCode({ ...keyCode, character });
|
|
228
|
+
}
|
|
229
|
+
if (isOSX) {
|
|
230
|
+
return this.getMacKeyCodeInterpretations(keyCode, input, layoutModifiers);
|
|
231
|
+
}
|
|
232
|
+
if (isWindows) {
|
|
233
|
+
return this.getWindowsKeyCodeInterpretations(keyCode, input, layoutModifiers);
|
|
234
|
+
}
|
|
235
|
+
return this.getLinuxKeyCodeInterpretations(keyCode, input, layoutModifiers);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
protected getLinuxKeyCodeInterpretations(keyCode: KeyCode, input: NormalizedKeyboardInput, layoutModifiers: LayoutModifiers | undefined): KeyCode[] {
|
|
239
|
+
if (!layoutModifiers || layoutModifiersIncludeAltGraph(layoutModifiers) && !input.altGraph) {
|
|
240
|
+
return [keyCode];
|
|
241
|
+
}
|
|
242
|
+
return layoutModifiers === 'shift'
|
|
243
|
+
? this.shiftLayerInterpretations(keyCode, layoutModifiers)
|
|
244
|
+
: [this.toLayoutModifiersKeyCode(keyCode, layoutModifiers)];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
protected getWindowsKeyCodeInterpretations(keyCode: KeyCode, input: NormalizedKeyboardInput, layoutModifiers: LayoutModifiers | undefined): KeyCode[] {
|
|
248
|
+
if (!layoutModifiers) {
|
|
249
|
+
return [keyCode];
|
|
250
|
+
}
|
|
251
|
+
if (!layoutModifiersIncludeAltGraph(layoutModifiers)) {
|
|
252
|
+
return this.shiftLayerInterpretations(keyCode, layoutModifiers);
|
|
253
|
+
}
|
|
254
|
+
if (input.ctrlKey && input.altKey) {
|
|
255
|
+
// Windows reports AltGr as Ctrl+Alt. A real Ctrl cannot be distinguished from it, so both are layout artifacts.
|
|
256
|
+
return [
|
|
257
|
+
new KeyCode({ ...keyCode, interpretation: 'commandModifiers' }),
|
|
258
|
+
this.toLayoutModifiersKeyCode(keyCode, layoutModifiers, { ctrl: true, alt: true })
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
if (input.altGraph) {
|
|
262
|
+
return [this.toLayoutModifiersKeyCode(keyCode, layoutModifiers)];
|
|
263
|
+
}
|
|
264
|
+
return [keyCode];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* macOS has no AltGraph key: Option selects the layout's AltGraph layer but is also the `alt` command modifier used by
|
|
269
|
+
* the default macOS bindings. Option layers therefore yield interpretations that keep Option as a command modifier and
|
|
270
|
+
* carry the character the key produces without Option, followed by the interpretation that attributes Option to the layout.
|
|
271
|
+
*/
|
|
272
|
+
protected getMacKeyCodeInterpretations(keyCode: KeyCode, input: NormalizedKeyboardInput, layoutModifiers: LayoutModifiers | undefined): KeyCode[] {
|
|
273
|
+
const mapping = input.code && this.shouldIncludeKey(input.code) ? this.getNativeMapping(input.code) : undefined;
|
|
274
|
+
if (!layoutModifiers) {
|
|
275
|
+
if (!input.altKey || keyCode.character) {
|
|
276
|
+
return [keyCode];
|
|
277
|
+
}
|
|
278
|
+
// Dead Option keys commit no character. Option is a command modifier on macOS, so the key's base character is used.
|
|
279
|
+
const deadKeyBaseCharacter = input.shiftKey
|
|
280
|
+
? mapping?.withShift && !mapping.withShiftIsDeadKey ? mapping.withShift : undefined
|
|
281
|
+
: mapping?.value && !mapping.valueIsDeadKey ? mapping.value : undefined;
|
|
282
|
+
if (!isPrintableCharacter(deadKeyBaseCharacter)) {
|
|
283
|
+
return [keyCode];
|
|
89
284
|
}
|
|
285
|
+
const optionCommand = new KeyCode({ ...keyCode, character: deadKeyBaseCharacter, interpretation: 'commandModifiers' });
|
|
286
|
+
return input.shiftKey ? this.shiftLayerInterpretations(optionCommand, 'shift') : [optionCommand];
|
|
287
|
+
}
|
|
288
|
+
if (!layoutModifiersIncludeAltGraph(layoutModifiers)) {
|
|
289
|
+
return this.shiftLayerInterpretations(keyCode, layoutModifiers);
|
|
90
290
|
}
|
|
91
|
-
|
|
291
|
+
if (!input.altKey) {
|
|
292
|
+
return [keyCode];
|
|
293
|
+
}
|
|
294
|
+
const optionLayer = this.toLayoutModifiersKeyCode(keyCode, layoutModifiers, { alt: true });
|
|
295
|
+
if (layoutModifiers === 'shiftAltGraph') {
|
|
296
|
+
const shiftCharacter = mapping?.withShift && !mapping.withShiftIsDeadKey ? mapping.withShift : keyCode.character;
|
|
297
|
+
const optionCommand = new KeyCode({ ...keyCode, character: shiftCharacter, interpretation: 'commandModifiers' });
|
|
298
|
+
return [
|
|
299
|
+
optionCommand,
|
|
300
|
+
this.toLayoutModifiersKeyCode(optionCommand, 'shift'),
|
|
301
|
+
optionLayer
|
|
302
|
+
];
|
|
303
|
+
}
|
|
304
|
+
const baseCharacter = mapping?.value && !mapping.valueIsDeadKey ? mapping.value : keyCode.character;
|
|
305
|
+
return [
|
|
306
|
+
new KeyCode({ ...keyCode, character: baseCharacter, interpretation: 'commandModifiers' }),
|
|
307
|
+
optionLayer
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** Interpret Shift either as a command modifier or as part of the keyboard layout. */
|
|
312
|
+
protected shiftLayerInterpretations(keyCode: KeyCode, layoutModifiers: LayoutModifiers): KeyCode[] {
|
|
313
|
+
if (!layoutModifiersIncludeShift(layoutModifiers)) {
|
|
314
|
+
return [keyCode];
|
|
315
|
+
}
|
|
316
|
+
return [
|
|
317
|
+
new KeyCode({ ...keyCode, interpretation: 'commandModifiers' }),
|
|
318
|
+
this.toLayoutModifiersKeyCode(keyCode, layoutModifiers)
|
|
319
|
+
];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
protected toLayoutModifiersKeyCode(keyCode: KeyCode, layoutModifiers: LayoutModifiers,
|
|
323
|
+
consumed: { ctrl?: boolean, alt?: boolean } = {}): KeyCode {
|
|
324
|
+
return new KeyCode({
|
|
325
|
+
key: keyCode.key,
|
|
326
|
+
character: keyCode.character,
|
|
327
|
+
ctrl: consumed.ctrl ? false : keyCode.ctrl,
|
|
328
|
+
meta: keyCode.meta,
|
|
329
|
+
shift: false,
|
|
330
|
+
alt: consumed.alt ? false : keyCode.alt,
|
|
331
|
+
layoutModifiers,
|
|
332
|
+
interpretation: 'layoutModifiers'
|
|
333
|
+
});
|
|
92
334
|
}
|
|
93
335
|
|
|
94
336
|
/**
|
|
@@ -116,40 +358,31 @@ export class KeyboardLayoutService {
|
|
|
116
358
|
return key.easyString;
|
|
117
359
|
}
|
|
118
360
|
|
|
361
|
+
/** Return the Latin letter registered for a physical key because the active layout does not produce it, or `undefined`. */
|
|
362
|
+
getLatinLetterFallback(key: Key): string | undefined {
|
|
363
|
+
return this.currentLayout?.latinFallbackByCode.get(key.code);
|
|
364
|
+
}
|
|
365
|
+
|
|
119
366
|
/**
|
|
120
367
|
* Called when a KeyboardEvent is processed by the KeybindingRegistry.
|
|
121
368
|
* The KeyValidator may trigger a keyboard layout change.
|
|
122
369
|
*/
|
|
123
|
-
validateKeyCode(keyCode: KeyCode): void {
|
|
124
|
-
|
|
370
|
+
validateKeyCode(keyCode: KeyCode, input: NormalizedKeyboardInput): void {
|
|
371
|
+
const character = input.key;
|
|
372
|
+
if (this.keyValidator && keyCode.key && isPrintableCharacter(character)) {
|
|
125
373
|
this.keyValidator.validateKey({
|
|
126
|
-
code: keyCode.key.code,
|
|
127
|
-
character
|
|
128
|
-
shiftKey:
|
|
129
|
-
ctrlKey:
|
|
130
|
-
altKey:
|
|
374
|
+
code: input.code ?? keyCode.key.code,
|
|
375
|
+
character,
|
|
376
|
+
shiftKey: input.shiftKey,
|
|
377
|
+
ctrlKey: input.ctrlKey,
|
|
378
|
+
altKey: input.altKey,
|
|
379
|
+
altGraph: this.isAltGraphActive(input)
|
|
131
380
|
});
|
|
132
381
|
}
|
|
133
382
|
}
|
|
134
383
|
|
|
135
|
-
protected transformKeyCode(inCode: KeyCode, mappedCode: KeyCode, keyNeedsShift: boolean): KeyCode | undefined {
|
|
136
|
-
if (!inCode.shift && keyNeedsShift) {
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
if (mappedCode.alt && (inCode.alt || inCode.ctrl || inCode.shift && !keyNeedsShift)) {
|
|
140
|
-
return undefined;
|
|
141
|
-
}
|
|
142
|
-
return new KeyCode({
|
|
143
|
-
key: mappedCode.key,
|
|
144
|
-
meta: inCode.meta,
|
|
145
|
-
ctrl: inCode.ctrl || mappedCode.alt,
|
|
146
|
-
shift: inCode.shift && !keyNeedsShift || mappedCode.shift,
|
|
147
|
-
alt: inCode.alt || mappedCode.alt
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
384
|
protected transformNativeLayout(nativeLayout: NativeKeyboardLayout): KeyboardLayout {
|
|
152
|
-
const
|
|
385
|
+
const candidatesByCharacter = new Map<string, KeyboardLayoutCandidate[]>();
|
|
153
386
|
const code2Character: { [code: string]: string } = {};
|
|
154
387
|
const mapping = nativeLayout.mapping;
|
|
155
388
|
for (const code in mapping) {
|
|
@@ -158,19 +391,33 @@ export class KeyboardLayoutService {
|
|
|
158
391
|
const mappedKey = Key.getKey(code);
|
|
159
392
|
if (mappedKey && this.shouldIncludeKey(code)) {
|
|
160
393
|
if (isWindows) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
this.addKeyMappings(key2KeyCode, mappedKey, keyMapping);
|
|
394
|
+
const windowsMapping = keyMapping as IWindowsKeyMapping & Partial<ILinuxKeyMapping>;
|
|
395
|
+
if (!windowsMapping.value && VKEY_TO_KEY[windowsMapping.vkey]) {
|
|
396
|
+
this.addKeyMapping(candidatesByCharacter, mappedKey, VKEY_TO_KEY[windowsMapping.vkey].easyString, 'none');
|
|
397
|
+
}
|
|
166
398
|
}
|
|
399
|
+
this.addKeyMappings(candidatesByCharacter, mappedKey, keyMapping as ILinuxKeyMapping & Partial<IMacKeyMapping>);
|
|
167
400
|
}
|
|
168
401
|
if (keyMapping.value) {
|
|
169
402
|
code2Character[code] = keyMapping.value;
|
|
170
403
|
}
|
|
171
404
|
}
|
|
172
405
|
}
|
|
173
|
-
|
|
406
|
+
const latinFallbackByCode = this.addMissingLatinLetterCandidates(candidatesByCharacter);
|
|
407
|
+
for (const candidates of candidatesByCharacter.values()) {
|
|
408
|
+
candidates.sort((left, right) => this.layoutModifierCost(left.layoutModifiers) - this.layoutModifierCost(right.layoutModifiers)
|
|
409
|
+
|| left.key.code.localeCompare(right.key.code));
|
|
410
|
+
}
|
|
411
|
+
const candidatesByFoldedCharacter = new Map<string, KeyboardLayoutCandidate[]>();
|
|
412
|
+
for (const [character, candidates] of candidatesByCharacter) {
|
|
413
|
+
const folded = character.toLocaleLowerCase();
|
|
414
|
+
const existing = candidatesByFoldedCharacter.get(folded) ?? [];
|
|
415
|
+
existing.push(...candidates);
|
|
416
|
+
existing.sort((left, right) => this.layoutModifierCost(left.layoutModifiers) - this.layoutModifierCost(right.layoutModifiers)
|
|
417
|
+
|| left.key.code.localeCompare(right.key.code));
|
|
418
|
+
candidatesByFoldedCharacter.set(folded, existing);
|
|
419
|
+
}
|
|
420
|
+
return { candidatesByCharacter, candidatesByFoldedCharacter, latinFallbackByCode, code2Character };
|
|
174
421
|
}
|
|
175
422
|
|
|
176
423
|
protected shouldIncludeKey(code: string): boolean {
|
|
@@ -181,73 +428,64 @@ export class KeyboardLayoutService {
|
|
|
181
428
|
return !code.startsWith('Numpad');
|
|
182
429
|
}
|
|
183
430
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
431
|
+
protected layoutModifierCost(layoutModifiers: LayoutModifiers): number {
|
|
432
|
+
return LAYOUT_MODIFIER_COST[layoutModifiers];
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Register VS Code-compatible US-position fallbacks for Latin letters that the layout does not produce
|
|
437
|
+
* on its base or Shift layer. This is called once whenever the active keyboard layout is transformed.
|
|
438
|
+
*/
|
|
439
|
+
protected addMissingLatinLetterCandidates(candidatesByCharacter: Map<string, KeyboardLayoutCandidate[]>): Map<string, string> {
|
|
440
|
+
const result = new Map<string, string>();
|
|
441
|
+
const produced = (lower: string, upper: string): boolean => [lower, upper].some(character =>
|
|
442
|
+
candidatesByCharacter.get(character)?.some(candidate =>
|
|
443
|
+
candidate.layoutModifiers === 'none' || candidate.layoutModifiers === 'shift'));
|
|
444
|
+
|
|
445
|
+
for (const lower of LATIN_LETTERS) {
|
|
446
|
+
const upper = lower.toUpperCase();
|
|
447
|
+
if (produced(lower, upper)) {
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
const key = VALUE_TO_KEY[lower].key;
|
|
451
|
+
const lowercaseCandidates = candidatesByCharacter.get(lower) ?? [];
|
|
452
|
+
lowercaseCandidates.push({ key, character: lower, layoutModifiers: 'none' });
|
|
453
|
+
candidatesByCharacter.set(lower, lowercaseCandidates);
|
|
454
|
+
|
|
455
|
+
const uppercaseCandidates = candidatesByCharacter.get(upper) ?? [];
|
|
456
|
+
uppercaseCandidates.push({ key, character: upper, layoutModifiers: 'shift' });
|
|
457
|
+
candidatesByCharacter.set(upper, uppercaseCandidates);
|
|
458
|
+
result.set(key.code, lower);
|
|
196
459
|
}
|
|
460
|
+
return result;
|
|
197
461
|
}
|
|
198
462
|
|
|
199
|
-
private
|
|
200
|
-
|
|
201
|
-
// compose a glyph and
|
|
202
|
-
//
|
|
463
|
+
private addKeyMappings(candidatesByCharacter: Map<string, KeyboardLayoutCandidate[]>, mappedKey: Key,
|
|
464
|
+
keyMapping: ILinuxKeyMapping & Partial<IMacKeyMapping>): void {
|
|
465
|
+
// Dead keys await a following keystroke to compose a glyph and never produce a committed character. The flags are
|
|
466
|
+
// currently reported only on macOS, but applying the guards uniformly keeps resolution and detection symmetric.
|
|
203
467
|
if (keyMapping.value && !keyMapping.valueIsDeadKey) {
|
|
204
|
-
this.addKeyMapping(
|
|
468
|
+
this.addKeyMapping(candidatesByCharacter, mappedKey, keyMapping.value, 'none');
|
|
205
469
|
}
|
|
206
470
|
if (keyMapping.withShift && !keyMapping.withShiftIsDeadKey) {
|
|
207
|
-
this.addKeyMapping(
|
|
471
|
+
this.addKeyMapping(candidatesByCharacter, mappedKey, keyMapping.withShift, 'shift');
|
|
208
472
|
}
|
|
209
473
|
if (keyMapping.withAltGr && !keyMapping.withAltGrIsDeadKey) {
|
|
210
|
-
this.addKeyMapping(
|
|
474
|
+
this.addKeyMapping(candidatesByCharacter, mappedKey, keyMapping.withAltGr, 'altGraph');
|
|
211
475
|
}
|
|
212
476
|
if (keyMapping.withShiftAltGr && !keyMapping.withShiftAltGrIsDeadKey) {
|
|
213
|
-
this.addKeyMapping(
|
|
477
|
+
this.addKeyMapping(candidatesByCharacter, mappedKey, keyMapping.withShiftAltGr, 'shiftAltGraph');
|
|
214
478
|
}
|
|
215
479
|
}
|
|
216
480
|
|
|
217
|
-
private addKeyMapping(
|
|
218
|
-
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
if (key2KeyCode[index] === undefined) {
|
|
222
|
-
key2KeyCode[index] = new KeyCode({
|
|
223
|
-
key: mappedKey,
|
|
224
|
-
shift,
|
|
225
|
-
alt,
|
|
226
|
-
character: value
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
private addWindowsKeyMapping(key2KeyCode: KeyCode[], mappedKey: Key, vkey: string, value: string): void {
|
|
233
|
-
const key = VKEY_TO_KEY[vkey];
|
|
234
|
-
if (key) {
|
|
235
|
-
const index = this.getCharacterIndex(key);
|
|
236
|
-
if (key2KeyCode[index] === undefined) {
|
|
237
|
-
key2KeyCode[index] = new KeyCode({
|
|
238
|
-
key: mappedKey,
|
|
239
|
-
character: value
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
protected getCharacterIndex(key: Key, shift?: boolean): number {
|
|
246
|
-
if (shift) {
|
|
247
|
-
return Key.MAX_KEY_CODE + key.keyCode + 1;
|
|
248
|
-
} else {
|
|
249
|
-
return key.keyCode;
|
|
481
|
+
private addKeyMapping(candidatesByCharacter: Map<string, KeyboardLayoutCandidate[]>, mappedKey: Key,
|
|
482
|
+
value: string, layoutModifiers: LayoutModifiers): void {
|
|
483
|
+
if (Array.from(value).length !== 1) {
|
|
484
|
+
return;
|
|
250
485
|
}
|
|
486
|
+
const candidates = candidatesByCharacter.get(value) ?? [];
|
|
487
|
+
candidates.push({ key: mappedKey, character: value, layoutModifiers });
|
|
488
|
+
candidatesByCharacter.set(value, candidates);
|
|
251
489
|
}
|
|
252
490
|
|
|
253
491
|
}
|
|
@@ -359,6 +597,24 @@ const VALUE_TO_KEY: { [value: string]: { key: Key, shift?: boolean } } = {
|
|
|
359
597
|
' ': { key: Key.SPACE },
|
|
360
598
|
};
|
|
361
599
|
|
|
600
|
+
function usCharacterIndex(key: Key, shift = false): string {
|
|
601
|
+
return `${key.code}:${shift}`;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
const LATIN_LETTERS = 'abcdefghijklmnopqrstuvwxyz';
|
|
605
|
+
|
|
606
|
+
const LAYOUT_MODIFIER_COST: Record<LayoutModifiers, number> = {
|
|
607
|
+
none: 0,
|
|
608
|
+
shift: 1,
|
|
609
|
+
altGraph: 2,
|
|
610
|
+
shiftAltGraph: 3
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const US_CHARACTER_BY_KEY = new Map<string, string>();
|
|
614
|
+
for (const [character, value] of Object.entries(VALUE_TO_KEY)) {
|
|
615
|
+
US_CHARACTER_BY_KEY.set(usCharacterIndex(value.key, !!value.shift), character);
|
|
616
|
+
}
|
|
617
|
+
|
|
362
618
|
/**
|
|
363
619
|
* Mapping of Windows Virtual Keys to the corresponding keys on a standard US keyboard layout.
|
|
364
620
|
*/
|