-
Notifications
You must be signed in to change notification settings - Fork 46
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
Handle special characters in variable names. #49
Comments
Is there a list of special characters that don't require |
Hmm I think @JamesWTruher, @daxian-dbw, or @SteveL-MSFT might know the answer to that. |
one more instance I know of is
|
You can look at the tokenizer code to see what characters are valid. Basically almost anything and if you use a brace, pretty much anything (including whitespace) until a closing brace. |
Thanks @SteveL-MSFT. Will need to give some thought to the best way to tackle variables. With so many ways to PowerShell a cat I want to cover all of the variable variants in as concise a manner as possible. The current definitions are not great. @daxian-dbw, part of me hates that those are real... part of me thinks that's super cool lol. |
@omniomi It seems that the main set of characters is [A-z0-9_?:]. However, if it's a colon followed by another colon, it's a static member and not part of the variable name like $a::b. And if a brace follows the |
@SteveL-MSFT that works and should probably cover most cases. I just need to figure out the best way to split everything in the repository so that it can be logically included in other places. How things are highlighted on their own, in strings, in sub-expressions, etc adds to the complexity. Can't just have one variable definition and use it everywhere. Splatting adds to complexity as well since |
From @SteveL-MSFT on May 17, 2017 22:58
$foo?bar = 1
"$foo?bar"
only $foo is highlighted as a variable, this causes confusion to the customer as PowerShell treats $foo?bar as the variable (which is allowed)
PSReadline highlights correctly
Copied from original issue: PowerShell/vscode-powershell#759
The text was updated successfully, but these errors were encountered: