ant-druha / intellij-powershell

Adds PowerShell language support to IntelliJ-based IDEs.
https://plugins.jetbrains.com/plugin/10249-powershell
Apache License 2.0
72 stars 20 forks source link

Parsing error of newline + pipe operator combination #182

Open En3Tho opened 8 months ago

En3Tho commented 8 months ago

Consider this example:

$q = 1,2,3 # or some multiline cli call
$q
| Where-Object { $_ -gt 1 }
| ForEach-Object { "I'm $_" }

VSCode has no problems parsing that but plugin is unable to do so. Is it hard to fix?

ForNeVeR commented 8 months ago

It is somewhat hard to deal with parser-related issues, since there's no official PowerShell grammar published for the modern PowerShell (at least I hadn't been able to find it). And the ones that were published as part of the documentation are sometimes contradictory[^1].

I have a queue of parser-related issues I'd like to eventually deal with, but so far I did little progress (better than nothing, but still not much).

You can try taking a look, I guess.

[^1]: Not saying they are actually contradictory in relation to this particular issue; it's totally possible that this is just a plugin bug, and not a problem of the published grammar.