-
Notifications
You must be signed in to change notification settings - Fork 499
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
Unable to open file on click in Problems Tab #1593
Comments
Ever since I turned on PSAnalyzer in options (for some reason it was off) it works partially and always borking out on those paths Before when I had it disabled it wasn't reporting anything but most of my problems may be related to how I build modules with folder, within folder and probably searching down isn't working correctly. Are you able to reproduce it? |
What version of PSSA is shown as imported in the PS integrated console? Run |
|
Nevermind. I see what is going on here. Thanks for the bug report. Will try to get this fixed. |
OK, I thought I knew what was going on but I can't repro this. On my PC I open a workspace and then open a file one level above it. In this case, I'm given the absolute path in the Problems window and double-clicking does open the file. This is what I see: So I assume you opened a workspace that had the Finding references will not search outside of the root workspace. Are you opening multi-root workspace? |
This is how it looks: I always open a folder PSWinReporting or PSWindocumentation or whatever and it has dirs in dirs. So I do it like you. With a Private\ Public folder, Ignore, Data and so on. But recently I started to add Public\AWS<file> Public\AD<file> In other words in DIR\DIR\file.ps1 or even DIR\DIR\DIR\file.ps1 - I remember once opening a large repository of my junk scripts and VSCode was failing to work properly (long time ago) but maybe it's still affecting VSCode? I am not opening multi-root. One project per VScode Instance. Notice how on your screen it takes InvokePlaster RelativePath and then the absolute path for build.psake.ps1? why does it do this differently? And in my case, it tries to do relative but for some reason fails. |
To be honest I don't get it It doesn't appear to be consisent. Notice how it's trying to take Absolute Path for the first 5 entries and then for the next 2 entries it's relative. What's more, it's actual folder within a folder. And it happens on same Project. I open PSSharedGoods as my main project and it took some of it in Relative and some absolute... But now thinking about it I use a tricky setup:
But I actually symlink that C:\Users\pklys\OneDrive - Evotec\Support to C:\Support so I can access it via C:\Support\GitHub\PSsharedGoods And then I do another trick where when I "build" my module I actually link files from My projects into PowerShellModule directory so that I can use Import-Module and test how it behaves for someone who would load it from PS Gallery. While I don't think Symlinks matter here because it works in some scenarios I am just adding this as a potential information. Closed, reopened VSCode: Same folder, same project. One Absolute path, the other one relative path. One working, one not. Not really sure where the difference is between them :-) |
So we think we know what is going on with these paths but it's going to take a bit of time to fix. What happens is that when PSES (running in the PSIC process) opens script files it creates simple filesystem paths. When those paths are passed back to VSCode, VSCode is expecting them to be in a particular Uri format. We are not converting those file system paths to this Uri format which causes this issue. @SeeminglyScience @rjmholt |
Take your time. I only wanted to ask whether this could be related to all my other problems. I seem to be hitting more and more "stuck" or formatting that never finishes, very long times to process everything and I'm wondering if this issue could be at all related? |
Just thought I would update this I've opened a folder and then I've used Open File and gave it full path It opened properly in VSCode, yet in the Problems tab, the path is totally incorrect. And the problems tab is showing different extension data (I've actually disable PSSA analysis due to this issue). I'm wondering whether this is a problem of only PowerShell extension, multiple extensions or VSCode itself? |
The next update |
System Details
System Details Output
Issue Description
In problems Tab it shows me file paths. But it seems you try to make it relative and something isn't playing well.
It seems that if there is depth higher then 1 relative path isn't relative to the path of folder but it goes back to C drive using full path but removing drive letter.
I suspect this problem often shows up in searching for definition or in other places (can't confirm it thou). I had times where I would click find 'Go To Definitions' and it would try to search for it for long time entering into infinite loop (showing the progress of searching but nothing really happens - the progress stays up even after I restarted PowerShell Session).
Maybe it manifests itself in other places (invisible to naked eye) as well so worth taking a deeper look.
Expected Behaviour
Relative Paths or full paths. Up to you ;-)
The text was updated successfully, but these errors were encountered: