Skip to content

Commit ef4c9b3

Browse files
Move Member to Property (#1337)
1 parent 6095ae5 commit ef4c9b3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ private static SemanticTokenType MapSemanticTokenType(Token token)
123123
return SemanticTokenType.Type;
124124
}
125125

126+
// This represents keys in hashtables and also properties like `Foo` in `$myVar.Foo`
126127
if ((token.TokenFlags & TokenFlags.MemberName) != 0)
127128
{
128-
return SemanticTokenType.Member;
129+
return SemanticTokenType.Property;
129130
}
130131

131132
// Only check token kind after checking flags

Diff for: test/PowerShellEditorServices.Test/Language/SemanticTokenTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function Get-A*A {
113113
}
114114

115115
[Fact]
116-
public async Task RecognizesArrayMemberInExpandableString()
116+
public async Task RecognizesArrayPropertyInExpandableString()
117117
{
118118
string text = "\"$(@($Array).Count) OtherText\"";
119119
ScriptFile scriptFile = new ScriptFile(
@@ -131,7 +131,7 @@ public async Task RecognizesArrayMemberInExpandableString()
131131
Assert.Single(mappedTokens, sToken => SemanticTokenType.Variable == sToken.Type);
132132
break;
133133
case "Count":
134-
Assert.Single(mappedTokens, sToken => SemanticTokenType.Member == sToken.Type);
134+
Assert.Single(mappedTokens, sToken => SemanticTokenType.Property == sToken.Type);
135135
break;
136136
}
137137
}
@@ -179,7 +179,7 @@ enum MyEnum{
179179
case "one":
180180
case "two":
181181
case "three":
182-
Assert.Single(mappedTokens, sToken => SemanticTokenType.Member == sToken.Type);
182+
Assert.Single(mappedTokens, sToken => SemanticTokenType.Property == sToken.Type);
183183
break;
184184
}
185185
}

0 commit comments

Comments
 (0)