-
Notifications
You must be signed in to change notification settings - Fork 510
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
F5 on a saved script isn't dot sourcing #3715
F5 on a saved script isn't dot sourcing #3715
Comments
I feel like I called this out earlier that it was using |
Totally possible. I felt like I had seen it before but couldn't quickly find anything |
@rjmholt Do you remember why you changed from dot-source to ampersand-execute? |
Feels to me like something we should change back just for consistency among user expectations. |
Probably an oversight. Moving away from dot-sourcing in the API is done for constrained language mode compatibility. In this case (if I've read correctly) that doesn't make sense because the debugger isn't going to work in CLM. Just remember that anything that dot-sources or uses |
Just wanna thank you for opening this issue. I've been searching "how to auto dot source when save file" and taught me F5 does dot source current file |
@Harryki just to clarify, F5 runs the default debug configuration, which typically is run current PS file by default. If you set the debug config to something else (like interactive mode or attach), it will always do that until you switch it again. Just an FYI to anyone else coming here who isn't sure why it isn't working for them, make sure your debug dropdown has run current file selected. |
Prerequisites
Summary
Looks like we're creating a new scope for invocation of script files, leaving any set variables and functions no longer accessible.
PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell-preview@2021.11.1
Steps to Reproduce
$a = 50
$a
in the PSICVisuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: