Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to pass arguments to command-based variables #38327

Closed
weinand opened this issue Nov 14, 2017 · 10 comments
Closed

Support to pass arguments to command-based variables #38327

weinand opened this issue Nov 14, 2017 · 10 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan

Comments

@weinand
Copy link
Contributor

weinand commented Nov 14, 2017

For launch.json and task.json configuration files VS Code supports variables that are based on commands. One limitation of this mechanism is that it is not possible to pass additional arguments to the command.

Examples:

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues tasks Task system issues labels Nov 14, 2017
@weinand weinand added this to the On Deck milestone Nov 14, 2017
@weinand weinand added the feature-request Request for new features or functionality label Nov 14, 2017
@bitjson
Copy link

bitjson commented Sep 5, 2018

I'm hoping to implement #50758 as an extension – any news on this feature request?

@isidorn
Copy link
Contributor

isidorn commented Sep 20, 2018

@weinand should we close this?

@bitjson
Copy link

bitjson commented Sep 20, 2018

@isidorn is this functionality available somehow? I'd love to be able to provide a parameter to a contributed command (for use in launch.json).

It doesn't seem like there's even a good hack to make that happen though – even if I parse the configuration to consume the parameter in a different way, the user is shown an error on unrecognized configuration options. So the only way to provide information to a command is by somehow embedding it in existing configuration options.

@RobertDeRose
Copy link

Would love for this feature to be supported

@weinand weinand modified the milestones: On Deck, December 2018 Dec 6, 2018
@weinand weinand removed the tasks Task system issues label Dec 6, 2018
@weinand
Copy link
Contributor Author

weinand commented Dec 6, 2018

Next week we will support passing arguments to command based variables via #64362:

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "Launch Program",
			"program": "${input:askForXYZ}"
		}
	],
	"inputs": [
		{
			"id": "askForXYZ",
			"type": "command",
			"description": "The XYZ to use"
			"command": "extension.foobar.someCommand",
		}
	]
}

@busticated
Copy link

@weinand will this also be supported via TaskProvider? (docs)

@weinand
Copy link
Contributor Author

weinand commented Dec 6, 2018

I don't understand your question but "input" variables (like the example from above) will be supported in task.json too.

@busticated
Copy link

I don't understand your question

if i'm providing tasks configuration via vscode.workspace.registerTaskProvider() (and related), will i be able to use "input" variables?

@weinand
Copy link
Contributor Author

weinand commented Dec 6, 2018

Are you able to use other variables, e.g. ${workspaceFolder} or ${env:HOME}?
If the answer is yes, then you are able to use "input" variables as well.

Sorry, I cannot give you a better answer because this issue is "debug" related, and I'm not an expert on "tasks".

@weinand
Copy link
Contributor Author

weinand commented Jan 7, 2019

this feature has become available via #64362.

@weinand weinand closed this as completed Jan 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

5 participants