Open snr278 opened 4 years ago
Hi @snr278,
Thank you for reporting this issue! Seems like we don't interpolate fileDirname
correctly.
fileDirname
works with Node debugging, whether in the envFile
path or as an env variable:fileDirname
works as an env variable in the Python launch config, but not when in the envFile
path:I just came across this bug today. I thought it was just me!
@kimadeline above you said
"we don't interpolate
fileDirname
correctly"
Please note that it is dangerous to interpolate variables yourself because you will miss newly introduced variables (and your variable substitution code might differ from VS Code's code).
A fully interpolated launch config is passed into the DebugConfigurationProvider
s method resolveDebugConfigurationWithSubstitutedVariables
. If you are already implementing a method resolveDebugConfiguration
then you can just rename that method to resolveDebugConfigurationWithSubstitutedVariables
and drop your own variable substitution code.
Thank you for the heads-up @weinand! We indeed use resolveDebugConfiguration
, so resolveDebugConfigurationWithSubstitutedVariables
is a very likely part of the solution (we still need to investigate further and see if there's anything else that could be causing this issue).
@mattgillard feel free to upvote the issue report to help us prioritize this.
Thanks!
This seems to work sometimes for me and other times it does not. Any ideas?
Environment data
"python.jediEnabled"
set to; more info #3977): Jedipython.languageServer
setting: MicrosoftExpected behaviour
configurations.envFile can use the variable ${fileDirname} (eg:"envFile": "${fileDirname}/${fileBasenameNoExtension}.env")
Actual behaviour
env variables define in file ${fileDirname}/${fileBasenameNoExtension}.env are not working.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` XXX ```
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)``` XXXX ```