-
Notifications
You must be signed in to change notification settings - Fork 511
debugger won't focus on files that are not under the current file's directory in vscode 1.31 #1750
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
I started seeing this near the end of January, but couldn't describe it this well. I suspect as there were no changes to the extension at the time it started to occur to me that it's a vscode issue, but I have no idea where to start looking. Another thing I noticed is that the debug sidebar doesn't list any variables while it's not in the current file. |
I'm having the same issue with VS Code 1.31. When I debug a Pester test, and step through the code into a function defined in a different file, the focus stays in the Pester file. When I switch back to VS Code 1.30.2, the step through works fine and VS Code switches into the file holding the function. I get the same behaviour with the PowerShell extension versions: 1.11.0 and 2..0.0 preview. |
Part of me is wondering if this is related to vscode bug: microsoft/vscode#67895 unfortuantely I don't know enough about the inner workings of the debugger in vscode to know if they're related |
having this problem as well. exactly as described. |
If the same version of the PowerShell extension does or doesn't have this across different VSCode versions, it's likely this is a VSCode issue. We'll need to work out if it's something they intended to break or not. |
Thanks guys, we are able to repro this. We will need to investigate further what changed in the release to have caused this. |
@SydneyhSmith please see issue microsoft/vscode#68616 that might be related (and my comment microsoft/vscode#68616 (comment)). Do you set the "deemphasized" hint on the top stack frames? |
Yes, I installed yesterday's 1.32.0-insider to test this, and it also de-emphasises the stack frames. |
Yes, the "smartStep" feature is specific to Node.js debugging. |
I did sort of expect that. I couldn't find anything else that seemed relevant though, so I thought I'd try it anyway :-) |
@weinand I am not aware of a deemphasizing top frames option, are there any plans to address this on the VSCode side? |
Please read my comment from above. |
We do support deemphasize but there isn't a setting to turn it off. But I can test it with that support disabled. |
This issue is so painful that I had to move back to VSCode 1.30.2. |
@isidorn #68616 is a show stopper! |
This is fixed in latest vscode insiders. |
I tested with the latest insider today I still have the worry 🙄 |
Version: 1.32.0-insider (user setup) it's confirmed, when I run the debug with F11 it does not go into the function |
Yes. I'm looking at either ripping out the feature altogether (not my first choice) or adding a debug config setting that defaults to:
@isidorn @weinand Any input on this approach? We basically look at the script path of each stack frame and if rooted in one of the sourceDirs, then it's a normal stack frame otherwise we deemphasize it. BTW it would be nice if we had an optional way to "force" step into "external" code. |
@DarkLite1 can you try the setting |
@rkeithhill that didn't work I'm afraid. Still the same issue when hitting "configurations": [
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File",
"script": "${file}",
"args": [],
"cwd": ""
}, |
I need this fixed badly too. Refactoring code across different modules kills the ability to debug it. |
OK, initially I'm going to disable this de-emphasize and then come back when I have some more time to implement this with settings to control it. Perhap @rjmholt could push out a bug fix update early next week? We have a few other bug fixes teed up for release. |
@rkeithhill Hopefully these will be global settings and not per project. |
Considering the following, I think the setting to have de-emphasized stack frames will probably be an opt-in setting:
Does anyone feel otherwise? |
That's good data. I wasn't sure what was better - using debug config or extension settings. The Node debugger uses debug config for enabling/disabling |
Keep it KISS guys. I've only worked with the PowerShell ISE, before I started using VS Code. So as @TylerLeonhardt stated, I've never worked with a debugger before. The more the window on the left pops-up, the more I try to close it every time as it takes up too much space (but this is another issue). When I want to see values of variables, I usually hover over them or type it in the console with some other commands to test things out after a breakpoint. I know it's maybe not best practice, but it's what I've learned by using the ISE. So IMHO, please try to make the config KISS or even unneeded to mimic the PowerShell ISE behavior. But that's just my 2 cents of course. It all depends on the target audience and what they'd expect. |
@rkeithhill I'm not apposed to making this a debug config setting, but the point I wanted to drive home was that it should be opt-in not opt-out. Also, Keith can you open a new issue to track creating the setting so we don't forget? |
Since the issue is closed I understand there is a workaround. From this discussion I did not understand what it is - could you give detailed instructions how to apply it? |
@MarkKharitonov a workaround has been applied. There's no work that needs to be done from the user's perspective. However, you must wait for the next release. |
Got it. Thank you very much.
|
@TylerLeonhardt Issue submitted - #1783 |
@TylerLeonhardt / @rkeithhill
|
In this version, in my case, it works only if I replace "cwd": "$ {file}" by "cwd": "C: \\" in the file launch.json |
@LaurentLienhard should it not work without making changes in debug configs? |
I believe what Tyler is saying is that it's fixed in the repository for the extension, but you need to wait for a release to be built for it to be fixed in the marketplace version of the PowerShell extension. |
That is just a "workaround" until the next release hits the marketplace. The fix in that release will not require any changes to your debug config. |
@rkeithhill Has a fix been made for the clicking
If not, does a new issue need creating? |
Thanks guys, let's hope it gets fixed in the preview extension too. As we're using that one for the |
The workaround will also be there :) |
For those curious about which version of vscode-powershell this issue was fixed in, it was included in release v1.12.0 and v2.0.0-preview.2 |
Unexpected behaviour in vscode 1.31:
Downgrade back to vscode 1.30.2 to see desired behaviour:
What changed between 1.30.2 and 1.31? Is this just a powershell issue or does it occur in other languages? It looks like it's trying to implement 'just my code' but I can find no way to turn it off except to stay on 1.30.2.
The text was updated successfully, but these errors were encountered: