Skip to content

VS Code does not use envFile during resolving variables in "program" configuration's property in launch.json. #254450

Closed as not planned
@shvydd

Description

@shvydd

A configuration in launch.json:

<!-- Describe the feature you'd like. -->
{
            "name": "Windows MinGW. GDB Launch",
            "type": "cppdbg",
            "request": "launch",
            "cwd": "${workspaceFolder}/build/MinGW/${input:buildType}",
            "envFile": "${workspaceFolder}/build/MinGW/${input:buildType}/bin/.env.vscode",
            "program": "${workspaceFolder}/build/MinGW/${input:buildType}/bin/${CMagneto__ProjectEntrypointExe}",
            ...
}

The .env.vscode (generated dynamically) file defines CMagneto__ProjectEntrypointExe variable.
Idea was to set the binary name in VC Code launch.json from the .env.vscode file.
But VS Code does not use the .env.vscode file during resolving variables in the value of the "program" property. Thus, the launch configuration doesn't work, until ${CMagneto__ProjectEntrypointExe} value is hardcoded in the launch.json file.

I believe, VS Code SHOULD use envFiles during resolving variables of the "program" properties in launch.json.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions