Skip to content

Document When Extension Commands Are Called With Arguments and What Those Arguments Are... #2409

Open
@busticated

Description

@busticated

hi there 👋

in certain circumstances commands provided by an extension are called with arguments. for example:

"editor/context": [
    {
        "command": "extension.myCommand",
        "when": "resourceLangId == cpp",
        "group": "my-tests"
    }
]

within your extension manifest (package.json) creates a context menu item for myCommand. when a user invokes that menu item by right-clicking and selecting it from the context menu, myCommand is called with a single argument: the uri for the file where the context menu was clicked.

my understanding just from poking around is that commands exposed via explorer/context, editor/title, and editor/title/context have similar behavior (though in some cases they are called with more and / or different arguments).

it would be nice if all of these cases were documented - specifically: when a command will be called with additional arguments and what those arguments will be

thanks 🙏👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    commandsdoc-enhancementsuggested addition or improvementexemptIssue is exempt from automated stale issue closureextensibilityextension author content under /api

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions