Closed bcrotty closed 6 years ago
It one of these things, that pretty hard to implement correctly. I prefer the current behavior: there may be some correct command names like Get-Contains
or Get-Join
, which will incorrectly highlighted when preceding word character removed. On the other hand $a-clt2
is a pretty unreadable programming style and I hope people don't write such code often.
I agree, but shouldn't the syntax mirror what PowerShell and the ISE actually do?
Yes, we should try to follow it. My point is, the second option is less preferable, because it confuses people with good programming style.
Ideally we should fix it, but I don't know how much work is it. Maybe you can take a look? :)
Planning on it :) Just wanted to document it.
Closing in favor of https://github.com/PowerShell/EditorSyntax
The following scopes all do not allow any word characters before them, which does not allow for the above legal syntax. The current syntax does correctly catch that the last example is wrong.
The three valid cases I've found are:
1-or1-gt2
)If you remove the check for preceding word characters, the syntax correctly identifies all but the last example, which it incorrectly allows.