Skip to content

Command handlers receive an empty object #42851

Closed

Description

  • VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:25:01.248Z)
  • OS Version: Darwin x64 17.4.0
  • Extensions:

Steps to Reproduce:
(create an extension)

  1. Create a VS Code command
  2. Register a command handler for the command
  3. Invoke the command from a command palette, and nothing is passed into the command handler. When invoked from a file or tree context menu then the file uri is passed.
  4. Add a keyboard shortcut to the above command
  5. However if the command is invoked via a keyboard shortcut, then an empty {} object is passed into the command handler.

Is this by design, to pass an empty object into the command handler when commands are invoked via the keyboard shortcuts.

Activity

  1. joaomoreno commented on Jun 1, 2018

    @joaomoreno
    Contributor

    alexandrudima Instead of [{}], I now get [null], which I argue is still not ideal. But I've documented it in the Release Notes anyway. I'm too scared to change it to something else. 😆

  2. alexdima commented on Jun 11, 2018

    @alexdima
    Member

    Good catch João Moreno (@joaomoreno)

    Turns out JS works differently than I would have thought when passing undefined as an argument in a function which uses var-args.

  3. added a commit that references this issue on Jun 11, 2018
    1e934ab
  4. locked and limited conversation to collaborators on Jun 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debt

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions