-
Notifications
You must be signed in to change notification settings - Fork 510
Extension constantly crashes #1652
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
This looks like the relevant problem:
Looks like we've counted a referenced file twice, possibly because there are multiple references to it in different ways. Shouldn't be too hard to fix. As a workaround @rudfoss, try commenting out any dot-sourcing and imports. If you add them back in one at a time and you get a crash, we've found our culprit. |
Great, thanks for your help! I know I have duplicate references so that's probably it. I tried to comment out the references and include them back one by one, but it doesn't appear to consistently crash the extension. Do I have to re-open the file for each import? Edit: The last file before the stack trace in the log seems to always be the same file though it has no dot-sourced references at all on it's own and is only referenced by one other ps1 file. |
I unsuccessfully filed an issue using the VSCode tool abut it was about the PowerShell console crashing frequently and is easily reproduceable by creating a new file, change the file type from PowerShell (that is set as my default language) to Plain Text. Does this fit within this issue or do I need to file a new one? Thanks |
@jkavanagh58 that sounds like #1649. |
So the key is not accept the standard behavior of VSCode when doing a basic Ctrl+N? I will have to see if I can change that in settings. If the problem is because the file name that VSCode creates then maybe fix the issue or change the filename it creates? |
It's not the file name, it's that it's an in-memory file, which lives under the The PowerShell extension tries very hard to make this abstraction work by building the same file in memory in its own process, but a reference-resolver update we took last release broke one of the code paths unfortunately because it assumed that all files live on the file system. We've now merged a PR to fix this. |
If you want a workaround, you should save the file with a PowerShell file extension and then start using it. |
Well @rjmholt I was seeing this (ironic but while demonstrating VSCode as a great tool) by creating a new file for pasting a large list of text and then changing the language from PowerShell to Plain Text. It was a demonstration of the multi-line editing (take a bunch of strings and wrapping them in quotes or whatever). I can wait for the fix sir. |
You may have Try removing that. |
I'm getting the same error now and was not before on the same file i've been working on for weeks. `2019-04-08 16:50:24.366 [NORMAL] tid:14 in 'StartLogging' C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 183
2019-04-08 16:50:24.377 [NORMAL] tid:14 in 'StartLanguageService' C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 202
2019-04-08 16:50:26.202 [ERROR] tid:4 in 'ProtocolEndpoint_UnhandledException' C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 448 |
Looks like when its trying to format text (or I see text move right before it crashes) it'll trigger the crash |
@hypercube33 you are experiencing #1830 |
System Details Output
Issue Description
I'm developing PowerShell scripts that connect to Azure (Using -Az modules). When I start up VSCode the extension starts, but after a short while it "terminates due to an error". I can restart it and it runs for a bit before suddenly crashing again. I've been unable to correlate it with anything I'm doing as it has happened both when editing a ps1 file as well as a JSON file. It also sometimes happens when the window doesn't even have focus or when closing tabs.
Expected Behaviour
It should not crash randomly
Actual Behaviour
It crashes randomly
Attached Logs
powershell-logs-1544625128-a7a83b7d-26c9-4a04-bf94-4ab6cb8606fc1544625123928.zip
The text was updated successfully, but these errors were encountered: