-
Notifications
You must be signed in to change notification settings - Fork 504
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
Starting debug crashes PowerShell session if project is in onedrive folder #1994
Starting debug crashes PowerShell session if project is in onedrive folder #1994
Comments
Thanks for opening an issue @jhoneill. This error looks pretty similar (but slightly different to) #1830. The relevant entry in the log is:
The So two things are:
|
@rjmholt thanks . here's a version of the log with diagnostic level turned on When I go to install a different version I've got the option for 2019.5.0 (released yesterday) or 1.12.1 (a month old) it looks like a new naming convention has been applied ... |
Oh yep that's totally right! I'm still converting over myself :) |
Here's the relevant line:
I'm not sure I've ever seen a Unescaping this renders it as I'll see if I can find more info, since it looks like we're forced to handle it (if only to quietly ignore it). |
Following VSCode's processes and being unable to find any documentation or issues that describe what this is, I've asked about this on StackOverflow. If that's not responded to by next week, I'll open an issue on VSCode. I'm not sure what VSCode expects us to be able to do with a message like this. Best case scenario we use the |
Ok, I've followed up with VSCode. This URI is coming from a git TextDocumentProvider, which we don't support. Instead of crashing, we should send back an error message. |
The code we need to change for this is here: https://github.com/PowerShell/PowerShellEditorServices/blob/84a3d3f2ccb4af4e73ed5270712862d1242a6bad/src/PowerShellEditorServices/Workspace/Workspace.cs#L417-L476 Documenting so I can get back to it. |
@rkeithhill, @TylerLeonhardt need to consult you on what those methods accept as an argument; I'm thinking it basically needs to be |
Sigh... It seems like we need to do some redesign of how we manage client document representation in PSES. We have these test methods scattered about. It seems like a workspace should have a collection/dictionary of these documents - which I think today is a ScriptFile collection. That seems a bit too PS centric to me. Maybe it would be better to have a collection of EditorDocuments or TextDocument or something more inline with the LSP terms. Then move the workspace tests internal to that class and provide props like Sorry, don't have time at the moment to look at the source so some of this may already be there but fundamentally, IIRC once we put something into a |
Totally on your page there @rkeithhill. I think this is worth patching in a small way for now and then we should come up with a better implementation going forward. I'll try and open a PR this week |
Any movement on a fix for this? Or at least how to work around it? I too am experiencing this issue all of the sudden and I have no idea why. I haven't added any new extensions. All of the sudden I can no longer execute PowerShell scripts in VSCode (it causes PowerShell terminal to crash). I am seeing the same issue with the "git:/" path in my error log. |
@scrambled2k3 we are hoping to get to this work item sooner rather than later but currently have no eta, thanks for your patience! In the meantime are you having trouble with all of your scripts or just those under this particular file structure? |
@SydneyhSmith Ok, no problem. I'm having the issue with all of my powershell scripts, no matter their location. I can execute them fine withing PowerShell ISE. |
System Details Output
OS is windows 10 1809 build
Issue Description
My WindowsPowerShell directory is on onedrive.
C:\Users\james\onedrive\WindowsPowerShell has a symbolic link to
C:\users\james\documents\WindowsPowerShell so profile etc is found.
Although I can use the directory under documents, VS-Code the likes to convert it to the canonical name so when I work on a project in my WindowsPowerShell directory it's the one under onedrive.
If I have the debugger set for PowerShell interactive session, pressing F5 to start it crashes the interactive session with the message "The PowerShell session has terminated due to an error" ... the stack trace in the log suggests a problem with the path.
If I copy the files from
C:\Users\james\onedrive\WindowsPowerShell\modules\foo to
C:\Users\james\temp\foo
Then all is well (so I have a work round).
Attached Logs
Editor services log attached. This has a stack trace from when the error occurs.
EditorServices.log
The text was updated successfully, but these errors were encountered: