Skip to content

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

Closed

Description

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.

Activity

  1. added
    debug
    on Jun 27, 2016
  2. changed the title [-]Test "attach to process" picker[/-] [+]Test "attach to process" picker and author another variable that is bound to a command[/+] on Jun 27, 2016
  3. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debugtestplan-item

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions