ant-druha / intellij-powershell

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

Error checking doesn't catch using <, > instead of the correct -lt, -gt in an if statement #266

Closed joshuaking-madtech closed 2 months ago

joshuaking-madtech commented 3 months ago

When an conditional mistakenly uses the <, > instead of the PowerShell -lt -gt compare operators, subsequent suggestions/code completion break but the error isn't highlighted.

ForNeVeR commented 3 months ago

Could you please show some examples of contexts when the plugin gets it wrong?

It could be that our (very relaxed) grammar misses the errors, while PSES-powered completion gets it right.

In certain cases, > may be valid in same places where -gt is, while having totally different meanings. Say,

 if (echo 12 > $null) { echo 1 } else { echo 2 }

is a perfectly valid syntactic construct, even if a bit meaningless.

github-actions[bot] commented 2 months ago

This issue was closed because it has been open for 14 days, but no requested information was received. Please leave a comment if you think this is a mistake.