Skip to content

coreclr debug configuration should support input variables for envFile #5102

@karolz-ms

Description

@karolz-ms

VS Code has a mechanism called "input variables" where debug configuration values can be resolved by running arbitrary commands, picking an item from predefined list, or prompting the user: https://code.visualstudio.com/docs/editor/variables-reference#_input-variables

Node.js and Python debug configuration providers support this mechanism. Unfortunately, coreclr seems to lack this support.

Repro steps

  1. Create a debug configuration that uses an input variable, for example
{
    "configurations": [
        {
            "name": "Debug API",
            "type": "coreclr",
            "request": "launch",
            // other properties as necessary
            "envFile": "${input:getPathToFile}"
        }
    ],
    "inputs": [
        {
            "id": "getPathToFile",
            "type": "promptString"
             // The really interesting/important case is type==command.
             // promptString is used just to simplify the repro
         }
    ]
}
  1. Try using the configuration

Expected result

Should prompt the user for the path to the .env file

Actual result

Can't parse envFile ${input:getPathToFile} because of Error: ENOENT: no such file or directory, open '${input:getPathToFile}'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions