Skip to content

Commit

Permalink
lsp: Recognise new token type for function name
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Apr 6, 2023
1 parent 61f5de9 commit 285c4ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/syntax-highlighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Fallback types are chosen based on meaningful semantic mapping and default theme
| `hcl-traversalStep` | `variable` |
| `hcl-typeCapsule` | `function` |
| `hcl-typePrimitive` | `keyword` |
| `hcl-functionName` | `function` |

#### Token Modifiers

Expand Down
3 changes: 3 additions & 0 deletions internal/lsp/token_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ func (te *TokenEncoder) resolveTokenType(token lang.SemanticToken) (semtok.Token
case lang.TokenTypePrimitive:
return te.firstSupportedTokenType(
semtok.TokenType(lang.TokenTypePrimitive), semtok.TokenTypeKeyword)
case lang.TokenFunctionName:
return te.firstSupportedTokenType(
semtok.TokenType(lang.TokenFunctionName), semtok.TokenTypeFunction)
}

return "", false
Expand Down

0 comments on commit 285c4ac

Please sign in to comment.