-
Notifications
You must be signed in to change notification settings - Fork 234
Null reference exceptions when trying to complete variable names #1926
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
I'm sorry, after a few hours I'm giving up on producing a useful example case. It seems like this only happens in large and complex scripts with lots of defined variables, which if true means a minimal example is literally impossible. It definitely happens on a After some wrangling I got |
I un-gave up and took a different approach and I now seem to have a reasonably-sized script that triggers it, and a decent log of the input from Kate for the entire session. Attached are (privacy sanitized) stdin and stdout from PSES, plus the script file (renamed with an additional .txt suffix to bypass GitHub restrictions). |
The error triggers upon typing the |
Hey, I was able to repro this! Interestingly the VS Code client doesn't crash after that fails, but the null reference exception is certainly happening, so we can hopefully get this fixed ASAP. Thank you so much for the detailed repro info!!! 🥳🥳🥳 |
@andschwa Ah, excellent to know it reproduces on VS Code! I guess the VS Code extension just doesn't complain about exceptions as loudly as Kate's LSP client. |
Fixed with a regression test! |
The completion code shouldn't throw errors so it's probably worth creating an issue in https://github.com/PowerShell/PowerShell to fix the underlying issue. |
Thanks so much @MartinGC94! |
Hi @alexbuzzbee! We just got this fixed in v3.6.0, can you verify for us? |
Well, I don't seem to be able to reproduce it anymore and it looks like the underlying issue has a fix committed too. Seems good to me. Thanks! |
Prerequisites
Steps to reproduce
I have PowerShell Editor Services configured in KDE Kate using a script that does essentially:
Sometimes, when I am typing a variable reference, PowerShell Editor Services throws a null reference exception. When it happens, it happens repeatedly, but I don't yet know the exact conditions. I will try to find specific trigger conditions tomorrow.
Expected behavior
Either a completion is offered successfully or fails silently.
Actual behavior
An exception is thrown, which is displayed in the editor window distractingly. (In Kate this is especially bad because the Output window pops up, grabbing keyboard focus.)
Error details
Environment data
Version
3.5.1
Visuals
No response
The text was updated successfully, but these errors were encountered: