-
Notifications
You must be signed in to change notification settings - Fork 19
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
Any way to support environment variables? #39
Comments
The debug adapter currently does not support this. To support custom environment variables, we might have to start the debuggee process externally and connect the debug adapter to it through a socket. This is, at least, what the Java extension does: microsoft/java-debug#89
|
Thanks for the reply. I'll have a try on the "attach" mode. |
I tried the attach configuration, unfortunately it didn't work. To reproduce% cd kotlin-quick-start
./gradlew run --debug-jvm
> Task :run
Listening for transport dt_socket at address: 5005
Run the Kotlin Attach config in vscode. But got the message below:
My launch.json is:
The Java Debug(Attach) works. It correctly attached and showed call stack. (Of cause it doesn't recognize kotlin breakpoints though.) A reproducing repo can be found here: |
It worked when I build the kotlin-debug-adapter locally. Maybe the one in the latest-release is out of date. |
Problem
Seems there is no way to pass environment variables to the kotlin-debug-adapter.
I need to pass database connection strings by environment variables in my project.
I'll be appreciated if any way provided to do this.
(If any hint to implement this, I'll try to add a pullrequest.)
To reproduce
Clone the kotlin-quick-start repo. Add the following line to Main.kt.
Use
./gradlew run
you can get the environment variables(MESSAGE=test)Use Kotlin Launch, I cannot get the environment variables.
I tried to add a "env" property to launch.json but there is no luck.
Appendix
launch.json
tasks.json
The kotlin-quick-start repo that reproduces.
https://github.com/thunderz99/kotlin-quick-start/tree/topics/test-environment-variables
The text was updated successfully, but these errors were encountered: