Skip to content

Crash when mixing key / keys and using whichkey.sortOrder #68

@The-Compiler

Description

@The-Compiler

Bug description

With the config below (note the accidental mixture of key and keys), depending on the exact config (?),

  • either "Activating extension 'VSpaceCode.vspacecode' failed: Cannot read properties of undefined (reading 'localeCompare')" gets shown
  • or (with this minimal example rather than my real config, it seems?), VS Code seems to freeze entirely.

To Reproduce

  • Start VS Code with a clean --user-data-dir
  • Copy the snippet below to your config
  • Trigger the VSpaceCode menu

Expected behavior

Not quite sure. Probably VSpaceCode should detect that this config is invalid and complain somehow?

Additional context

With my real config:

notificationsAlerts.ts:40 TypeError: Cannot read properties of undefined (reading 'localeCompare')
    at u (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:1208)
    at l (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:1312)
    at Array.sort (<anonymous>)
    at g (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:22724)
    at g (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:22749)
    at g (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:22749)
    at g (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:22749)
    at g (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:22749)
    at _ (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:24345)
    at t.default.register (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:24550)
    at t.WhichKeyRegistry.register (/home/florian/.vscode/extensions/vspacecode.whichkey-0.11.3/dist/extension-node.js:1:26336)
    at o._executeContributedCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:31333)
    at o._doExecuteCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:30153)
    at o.executeCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:30059)
    at Object.executeCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:31789)
    at /home/florian/.vscode/extensions/vspacecode.vspacecode-0.10.9/dist/extension-node.js:1:49117
    at e.activate (/home/florian/.vscode/extensions/vspacecode.vspacecode-0.10.9/dist/extension-node.js:1:49224)
    at Function._callActivateOptional (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:88:17454)
    at Function._callActivate (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:88:17119)
    at /opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:88:14937
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _activate (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:8180)
    at _waitForDepsThenActivate (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:8122)
    at _initialize (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:7486)

Keybindings

None.

Settings

Click to toggle contents of `settings.json`

{
    "whichkey.sortOrder": "nonNumberFirst",
    "vspacecode.bindingOverrides": [
        {
            "keys": ["x"],
            "name": "+Tox",
            "icon": "play",
            "type": "bindings",
            "bindings": [
                {
                    "key": "a",
                    "name": "Run tox",
                    "icon": "play",
                    "type": "command",
                    "command": "python-tox.select"
                },
                {
                    "keys": "t",
                    "name": "Run tox",
                    "icon": "play",
                    "type": "command",
                    "command": "python-tox.select"
                },
            ]
        },
    ]
}

System information

image

List of enabled extensions is too long to screenshot (as the --user-data-dir override ignores the extensions I actually have disabled in my main instance), but I doubt it's relevant really. VSpaceCode v0.10.9 and which-key v0.11.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions