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

Parsing doesn't work for script block passed as a function argument #160

Closed
ForNeVeR opened this issue Oct 4, 2023 · 3 comments · Fixed by #168
Closed

Parsing doesn't work for script block passed as a function argument #160

ForNeVeR opened this issue Oct 4, 2023 · 3 comments · Fixed by #168
Assignees
Labels
bug Something isn't working parser Issues related to PowerShell script parsing

Comments

@ForNeVeR
Copy link
Collaborator

ForNeVeR commented Oct 4, 2023

Consider this valid code:

$null = Register-ObjectEvent -InputObject $process -EventName 'Exited' -Action { [System.Environment]::Exit(0) }

intellij-powershell breaks in it:
image

@ForNeVeR ForNeVeR added bug Something isn't working help wanted Extra attention is needed parser Issues related to PowerShell script parsing labels Oct 4, 2023
@ForNeVeR
Copy link
Collaborator Author

ForNeVeR commented Nov 4, 2023

The underlying problem seems to be that we are unable to parse [System.Environment]::Exit(0).

@ForNeVeR ForNeVeR self-assigned this Nov 4, 2023
@ForNeVeR ForNeVeR removed the help wanted Extra attention is needed label Nov 4, 2023
@ForNeVeR
Copy link
Collaborator Author

ForNeVeR commented Nov 4, 2023

A-ha, and the problem is even in the method name!

[System.Environment]::Exi(0) gets parsed correctly.

[System.Environment]::Exit(0) doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Issues related to PowerShell script parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant