Skip to content
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

Extraneous parentheses cause errors to be reported on valid code #268

Open
joshuaking-madtech opened this issue Apr 18, 2024 · 4 comments
Open
Assignees
Labels
bug Something isn't working status:waiting-for-info For issues that need additional information from the users

Comments

@joshuaking-madtech
Copy link

$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:
image
Ditto PS 7 on Linux:
image

Plugin:
image
image

@joshuaking-madtech
Copy link
Author

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.

@ForNeVeR
Copy link
Collaborator

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?

@ForNeVeR ForNeVeR added bug Something isn't working status:waiting-for-info For issues that need additional information from the users labels Apr 18, 2024
@joshuaking-madtech
Copy link
Author

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.

@ForNeVeR
Copy link
Collaborator

ForNeVeR commented Apr 19, 2024

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:waiting-for-info For issues that need additional information from the users
Projects
None yet
Development

No branches or pull requests

2 participants