-
Notifications
You must be signed in to change notification settings - Fork 49
Properties called directly on @(Array) declaration not scoped. #146
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
Comments
From #1522 |
This is the same as issue #141. Unfortunately I don't know how to combine them nor if I should. |
Thanks for that @PSPally. I'll close this as a dupe of #141. |
So, this is less that properties/methods within a sub-expression are incorrect and more that we didn't account for people calling methods on an array declaration. Now, your syntax is valid so I'll work on getting that added at some point; However, is there a reason for doing it that way in your code instead of just using PS C:\> $Array = 1..10
PS C:\> "$(@($Array).Count) Blah"
10 Blah
PS C:\> "$($Array.Count) Blah"
10 Blah |
Thanks for looking at this @omniomi . The reason is indeed that we're not certain that |
A quick correction, (noting that static members are allowed here too). (I might be using a different scope for the member here than the regular syntax is using) For the end of the array definition: "end": "(\\))((?:(?:\\.|::)(?:\\p{L}|\\d|_)+)*\\b)?",
"endCaptures": {
"1": {
"name": "punctuation.section.group.end.powershell"
},
"2": {
"name": "variable.other.member.powershell"
}
}, It also turns out that this can work for Hash table definitions as well: @{name="bob";age=42}.count |
Add scriptblocks to the list of items that should have member access scoped, not a common item by any means, as I am not sure it has any practical uses in a script file. |
Methods look like a string when called between
$()
:The text was updated successfully, but these errors were encountered: