Open joshuaking-madtech opened 3 months ago
That's weird, it works fine after closing and re-opening Rider. I've had it a couple times now that it does something like this on obviously valid code after copy pasting code back and forth. I'll update if I manage to get a reliable reproduction.
I think it could happen in case the document model was suddenly desynchronized between the editor and the LSP server.
Could you please get the IDE logs, noting the exact time when something like this happens?
I think it could happen in case the document model was suddenly desynchronized between the editor and the LSP server.
Could you please get the IDE logs, noting the exact time when something like this happens?
Will do. It's been well behaved so far today but I'll keep an eye out.
Just to be a little more specific, when I was having problems yesterday I was copying most or all of the script I had started in ISE into Rider (and then promptly forgetting which one I'd made changes in last), and also pasting the script back and forth to a VM to test cross-platform. The clipboard sync to the VM (virt-viewer) sometimes takes a second to cough up the text after hitting paste.
Hopefully the clipboard sync shouldn't be an issue here: we do not query the clipboard anywhere in the plugin; we only look at the active document and sync it with the language server. I wonder if quick (or sudden) changes to it may cause some hiccups.
(And of course we want to fix these.)
$rootString = if(($PSVersionTable).Platform -like "Unix"){"/"} else{"$env:SystemDrive*"}
The parentheses around $PSVersionTable above are unnecessary but are valid; this should possibly make a style suggestion to remove them Working in PS 5.1 on Windows:Plugin:
![image](https://github.com/ant-druha/intellij-powershell/assets/118769311/06457688-baae-43cb-bb84-e457d9bc0917)