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

Allow nls before pipe operator #236

Open En3Tho opened 4 months ago

En3Tho commented 4 months ago

This "sorta" fixes https://github.com/ant-druha/intellij-powershell/issues/182 Better than failing completely but stiill wrong so I need a hint how to do this properly:

1, 2, 3
| Foreach-Object { $_ }

This one should work (does with this pr)

1, 2, 3

| Foreach-Object { $_ }

This one should not work (but still does with this pr). Seems like /n/n leads to An empty pipe element is not allowed. error on pipe character in vscode/pwsh.

I tried to play with new_line_char instead of nls but no matter what I do it does still parse it as nls. Basically I want to check if there is a thing sorta like nls but should only have exactly 1 line feed (nls allows however many of those). Can you help me with that?

Also, a small qol improvement: using -NoProfile flag when starting pwsh to get module version. Fails on my machine due to some extensions loading first. We want to avoid that by launching pwsh witn no profile

En3Tho commented 4 months ago

@ForNeVeR Sorry for the delay. Your fix seems to fix my case. I've mostly did a visual check for now using vscode/current pwsh plugin/your branch. What are the next steps here? Should I close this one and add tests to the one you've mentioned?

ForNeVeR commented 4 months ago

Alright, I've opened a PR from that branch. This PR will be superseded by that.