Closed bvisin closed 5 years ago
I'm cool with this. I'll start working on it now, shouldn't be too difficult to implement; we can leverage something like this dotenv npm package for the .env parsing (4,410,783 weekly downloads...it's probably stable enough lol)
I have a working version of this feature in this branch: https://github.com/TwitchBronBron/vscode-brightscript-language/tree/feature/dotenv-support-in-launch
Can you pull it down and try it out? Let me know if that solves your needs.
@TwitchBronBron Pulled down the branch and works perfect! Thanks for jumping on this so quickly! Really appreciate the addition. I'll continue to use the branch for a while to see if I notice any abnormalities, but I would say this is a great feature that should be included in the next release.
@TwitchBronBron I am seeing an issue with the remote not working as the remote pulls the IP from the launch file...
BrightScriptCommands.ts:109
rejected promise not handled within 1 second
extensionHostProcess.js:768
So I think we can easily detect ${env:VAR}
and replace that with the env variable...not sure how that all works with different processes as I would like to be loading that in from the .env file but I will try and look into it when I get some time.
@bvisin thanks for fixing that issue. This feature is included in release 1.8.0
. If you find any more issues with this implementation, please open a new ticket.
Awesome @TwitchBronBron Thank you!
I would like to have a launch config file like:
I think VS Code does this for node debugging: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_load-environment-variables-from-external-file-node
https://github.com/Microsoft/vscode/issues/15964
https://github.com/Microsoft/vscode/issues/14523
But I would like to add this functionality to the BS debugger as well.