-
Notifications
You must be signed in to change notification settings - Fork 511
"Unable to open 'File': resource is not available." when clicking on psscriptanalyzer problem #1732
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
Now replicated for all three people in my team. |
I believe what you are seeing is an issue we've already seen. It should be fixed in the next update. Still, could you upload your log files here so we can double check the root cause of what you're seeing? https://github.com/PowerShell/vscode-powershell/blob/master/docs/troubleshooting.md#logs |
1548754604-8a65a9c9-d1e1-4d68-b361-d2c171bc13631548754580034.zip I set the log level, then restarted VSCode (to get clean logs from startup), then opened a module, which triggered the extension to load. Once it had loaded (took several seconds) I then clicked on a few issues, but that all worked fine. I closed the file and opened it again, and it still worked fine, so I opened a different file, and that had the issue. |
Yep, you are running into the known issue. When the extension publishes diagnostics for a file that you have opened explicitly, the link should work because it is returned to VSCode in the correct URI format e.g.:
However, if the extension itself opens the file and analyzes it (say it was dot-sourced or analyzed via the code lens provider) then it returns a file URI that is not properly encoded for VSCode:
|
Interesting. Because in the above case I opened the file through VS Code, which them made the Problems list pop up, and then I clicked on an item in the Problems list. Which you say should have worked... |
That's how I observed the problem occurring on my machine. There may be other failure modes. |
Having the same issue: The first time it worked, the second failed with the same uri pattern you showed.
|
@andrewducker sorry to follow up so late, but is this still an issue? Please let me know! |
Sorry, not getting to work with PowerShell much at the moment, and so I don't have anything set up that I could test this with. |
Ok! I'm going to close as resolved then. Thank you! |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
Issue Description
When I click on a warning/error/info in the "Problems" tab, it then fails to open the file (which is, by the way, already open) and gives the error
Unable to open 'File.ps1': resource is not available.
This happens with both modules and scripts.
It doesn't happen every single time, but more than 50% of the time.
Attached Logs
I turned logging up to Diagnostic. There was nothing coming up for this error. There were message in the analysis file for the file being opened/analysed/closed, but no errors.
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: