question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Contribute commands with additional arguments

See original GitHub issue

Hello, I’m creating an extension to provide easily accessible documentation shortcuts from the command palette in the editor. Currently it does not seem possible to do something like this (where otherArg would be an arbitrary argument in package.json):

    "contributes": {
        "commands": [
            {
                "command": "extension.doSomething",
                "title": "Example Title",
                "otherArg": "some other argument"
            }
        ]
    },

I see that a similar question has been asked here https://github.com/Microsoft/vscode/issues/26436 and also in a resulting (unanswered) SO post here https://stackoverflow.com/questions/43909741/can-i-pass-arguments-to-command-in-contributes-block.

Is this a feature that would be considered? If not, how might this type of thing be accomplished from the extension developer’s perspective? I see there is an args parameter for command handler functions, but I’m not seeing a way to call executeCommand from the package.json file.

For reference, here is a screenshot of how my equivalent package looks in the command palette in sublime text: image

Thanks!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:14
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vscodebot[bot]commented, Jan 22, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

1reaction
jriekencommented, Jan 16, 2018

I believe @bpasero has done that, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow passing args inside entries of Npm Scripts Explorer ...
Feature Request : Allow passing args inside entries of Npm Scripts Explorer # ... This commands would show an input box using vscode.window....
Read more >
Contribution Points | Visual Studio Code Extension API
Contribute the UI for a command consisting of a title and (optionally) an icon, category, and enabled state. Enablement is expressed with when...
Read more >
pFUnit / Feature Requests / #38 Allowing pass command argument ...
I have a module having a lot of get_command_argument call. I need to pass command arguments in order to test those procedures with...
Read more >
TestComplete Command Line - SmartBear Support
Commands TestComplete to execute tests provided by the project suite or project specified by the file_name argument or tests provided by a project...
Read more >
picocli - a mighty tiny command line interface
... requests for usage help or version help can be done with one line of code. public static void main(String... args) { int...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found