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

environment file and variables don't work #1563

Open
Greeley opened this issue Apr 20, 2023 · 3 comments
Open

environment file and variables don't work #1563

Greeley opened this issue Apr 20, 2023 · 3 comments

Comments

@Greeley
Copy link

Greeley commented Apr 20, 2023

            "envFile": "${workspaceFolder}/.vscode/.env",
            "vmargs": [ 
                "-Xmx512M",
                "-DprojectCode=${env:projectCode}",

there is a projectCode=x line in the .env file so I expect the command to be run to contain -DprojectCode=x instead it gives -DprojectCode= which means my tests don't run.

This happens for every single environment variable I have.

@jdneo
Copy link
Member

jdneo commented Apr 21, 2023

Now the envFile only works inside your running tests.

${xxx:yyy} is not supported when referencing a variable defined in the envfile.

@jdneo
Copy link
Member

jdneo commented Apr 21, 2023

@testforstephen Is this something that VS Code can handle, or we need to implement it by our own?

@testforstephen
Copy link
Contributor

VS Code only supports substituting environment variables from system environment variable set. See https://code.visualstudio.com/docs/editor/variables-reference

envFile is a property contributed by Java debugger, I don't think VS Code supports reading them when replacing variables reference in launch.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants