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

Test "attach to process" picker and author another variable that is bound to a command #8196

Closed
3 tasks done
weinand opened this issue Jun 27, 2016 · 0 comments
Closed
3 tasks done
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues testplan-item
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Jun 27, 2016

Test for #6569:

VS Code supports variable substitution in launch configurations for some time.
With this release extension authors can introduce a new kind of variable that binds to a command.
These commands can be registered in an extension and their return value is used as the variable's value and the implementation of the command can use whatever UI is available for an extension.
When a debug session is started, all command variables that occur in the underlying launch config are first collected and then executed. Multiple occurrences of a variable do not result in multiple execution. At the end the variables in the launch configuration are substituted with the command results.

An example for this functionality can be found in node-debug. Here a variable ${command.PickProcess} is bound to a process picker command. A new 'Attach to Process' launch config uses the variable to let the user pick a 'node' process when running the launch config.

  • Verify that this process picker behaves correctly on every platform.
  • Try to break it.

Verify that the mechanism can be used by extension authors:
Create a new command variable that maps to another command, e.g. some string input UI that asks for a host id, or a picker that gets some QuickPick choices from the launch config, and returns the selected item.

The simplest way to do this is:

  • clone https://github.com/Microsoft/vscode-node-debug.git
  • add a new command in src/extension.ts
  • add a new 'variable' to the debuggers contribution point in the package.json
  • run the extension with F5
  • try to use it in a launch config that passes the variable as an argument in the args attribute to a simple node program that prints the arg.
@weinand weinand added this to the June 2016 milestone Jun 27, 2016
@weinand weinand self-assigned this Jun 27, 2016
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jun 27, 2016
@weinand weinand removed their assignment Jun 27, 2016
@weinand weinand changed the title Test "attach to process" picker Test "attach to process" picker and author another variable that is bound to a command Jun 27, 2016
@aeschli aeschli closed this as completed Jun 28, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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 testplan-item
Projects
None yet
Development

No branches or pull requests

2 participants