-
Notifications
You must be signed in to change notification settings - Fork 679
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
argsFile and envFile in launch.json #1944
Comments
@gregg-miskelly: I wanted to implement this feature myself. The only thing I managed so far is modifying ./src/tools/OptionsSchema.json Can you give me a hint on where to look for the launch.json being parsed and those values being passed to the debugger? I'm a total Java/TypeScript beginner. |
Here is how I think you could implement it: VS Code will call The underlying .NET Cored debugger that this extension launches, isn't an open source product. So if that doesn't work this feature would need to be implemented by a Microsoft employee unfortunately. |
So, vsdbg parses the launch.json. That would have been my next guess. Sounds like it shouldn't been touched and vsdbg should be modified instead. And I don't mind if a Microsoft employee finishes the job ;-) |
Here is the flow: VS Code reads the launch.json file, it sends the content of the active configuration to You are certainly welcome to wait -- this seems like a fairly simple and useful feature request. That said, I don't think there is anything wrong with implementing this feature in |
My guesses turn out to be correct then. I'll give it a try :) |
@gregg-miskelly, got it working :) |
Can't you use the value of the |
You mean like: if |
Yes, that was my suggestion. You could certainly try searching VSCode's source code and see if they either have some code you can borrow or an API you can call. But I don't know the answer off hand. |
Haven't found an API yet. Pushed PR #1951 though. |
Sorry to necro but why is this closed? It is still not possible to use args in combination with the envFile. I guess that it would require a 2-step replacement on launch, which doesn't seem to be implemented (or at least it is not working for me). Is that accurate? E.g. support the following {
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"host": "127.0.0.1",
"program": "${workspaceFolder}/cmd/api",
"envFile": "${workspaceFolder}/config/.env",
"args": [
"-smtp-username", "${env:SMTP_USERNAME}",
"-smtp-password", "${env:SMTP_PASSWORD}",
"-auth-url", "${env:AUTH_URL}",
"-db-dsn", "${env:DB_DSN}",
],
"showLog": true
}
]
} Expected Result: the |
Its closed because @SebastianPfliegel kindly submitted a PR to fix the part that he wanted. I don't know off hand if VS Code makes the syntax you are suggesting there possible. But you are welcome to open another feature request issue. |
Environment data
dotnet --info
output:VS Code version: 1.19.1
C# Extension version: 1.13.1
Feature request
In my launch.json I need to pass sensitive data (like passwords) as arguments (or environment variables). As the launch.json is also committed to Git it's unwise to place the arguments in there. In NodeJS it is already possible to pass a file containing all the arguments (microsoft/vscode#14523 and microsoft/vscode-node-debug2@b3e2e8f3).
The text was updated successfully, but these errors were encountered: