-
Notifications
You must be signed in to change notification settings - Fork 235
Fix crash when seting PSSA rules w/Untitled active editor #606
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
Fix crash when seting PSSA rules w/Untitled active editor #606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, Keith 😄 I think this crash happened to me today - thanks! 👍
I think that the Workspace should be able to retrieve an untitled file, right? I'm doing that in the DebugAdapter here: What was the stack trace of the crash? |
Basically in the handler for setting PSSA rules, the code calls |
I wonder if VS Code changed how they represent untitled paths? Can you tell what original path it was trying to resolve before that? Should start with |
I was going to bring up at the PS Community mtg during the PSES part that I've seen a number of errors recently related to working with Untitled (in memory) files. I'm guilty of fixing them onesy/twosy. Could be I'm not seeing the proper API or maybe we need to attack the problem more holistically. |
No, it was literally |
Found the true source of the problem: I think you need to get rid of the |
Might require calling |
Check out the stack trace on this one #569 - same issue? |
Nah, in this one VS Code sent us a totally invalid Uri, there's only 1 slash for the scheme Might be worth checking if running the Git Diff viewering on a .ps1 file still causes this crash |
So that other folks don't do this:
Should we create a helper method ( BTW |
hmmm... According to the API docs toString is supposed to give the full Uri path: Weird that it'd return a string with .fsPath at the end. Is it possible to console.log() the whole uri object to see what it's got in it? |
Fixed this a better way via - PowerShell/vscode-powershell#1244 |
Closing this as this has been fixed in vscode-powershell - PowerShell/vscode-powershell#1244 |
Fix issue 1155 in vscode-powershell - PowerShell/vscode-powershell#1155