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 committed Jul 22, 2024
1 parent 41fce39 commit 793aed0
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 793aed0

Please sign in to comment.