Skip to content

Commit

Permalink
Add new Decorator and Label semantic tokens for attributes and loop l…
Browse files Browse the repository at this point in the history
…abels. Also removes the incorrect Generic -> Function mapping.
  • Loading branch information
MartinGC94 authored and andyleejordan committed Sep 4, 2024
1 parent a99180d commit 2bb4280
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ private static SemanticTokenType MapSemanticTokenType(Token token)
return SemanticTokenType.Operator;
}

if ((token.TokenFlags & TokenFlags.AttributeName) != 0)
{
return SemanticTokenType.Decorator;
}

if ((token.TokenFlags & TokenFlags.TypeName) != 0)
{
return SemanticTokenType.Type;
Expand Down Expand Up @@ -142,8 +147,8 @@ private static SemanticTokenType MapSemanticTokenType(Token token)
case TokenKind.Number:
return SemanticTokenType.Number;

case TokenKind.Generic:
return SemanticTokenType.Function;
case TokenKind.Label:
return SemanticTokenType.Label;
}

return null;
Expand Down

0 comments on commit 2bb4280

Please sign in to comment.