Skip to content

Commit 3249cd9

Browse files
MartinGC94JustinGrote
authored andcommitted
Add new Decorator and Label semantic tokens for attributes and loop labels. Also removes the incorrect Generic -> Function mapping.
1 parent 5fb353c commit 3249cd9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ private static SemanticTokenType MapSemanticTokenType(Token token)
108108
return SemanticTokenType.Operator;
109109
}
110110

111+
if ((token.TokenFlags & TokenFlags.AttributeName) != 0)
112+
{
113+
return SemanticTokenType.Decorator;
114+
}
115+
111116
if ((token.TokenFlags & TokenFlags.TypeName) != 0)
112117
{
113118
return SemanticTokenType.Type;
@@ -142,8 +147,8 @@ private static SemanticTokenType MapSemanticTokenType(Token token)
142147
case TokenKind.Number:
143148
return SemanticTokenType.Number;
144149

145-
case TokenKind.Generic:
146-
return SemanticTokenType.Function;
150+
case TokenKind.Label:
151+
return SemanticTokenType.Label;
147152
}
148153

149154
return null;

0 commit comments

Comments
 (0)