-
Notifications
You must be signed in to change notification settings - Fork 511
Allow running/debugging a file in a workspace without adding an entry in launch.json #3710
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
Comments
@andschwa I don't think this is particularly unreasonable, it's pretty easy to "embed" a default launch configuration, we already do it via the pester "Run Tests" codelens. |
Yup, I agree. This is something that bugs me too, would love to see it fixed. Not even sure if this is a feature request so much as a bug fix as I think it's an error that the extension just uses the current launch configuration. My guess is the vast majority of use cases for a PowerShell file would be (and are) the default "run this file" configuration. |
It took a bit to figure out what exactly was going on here since I was making assumptions based on other erroneous behavior I was seeing. What we're actually looking to do in order to fix this is modify this command: vscode-powershell/src/features/ExtensionCommands.ts Lines 226 to 227 in 44d8f40
So instead of calling |
Prerequisites
Summary
I am new to using the powershell extension, but have previously used the python extension. The python extension adds an editor button to run or debug the current file, ignoring anything from launch.json. See
from here.
I incorrectly assumed that when I pressed the similar looking button that the powershell extension provides on a ps1 file that it would just run that file. Instead, it runs the current configuration that I have selected in the debugger view (which happened to be some python thing completely unrelated to the powershell file open in the editor).
Proposed Design
My preference would be for the button to work like the python extension, although I imagine that would confuse people already used to be current behaviour. At the very least changing the tooltip from "Run" to something like "Run selected configuration" would have saved me some confusion.
The text was updated successfully, but these errors were encountered: