11package dev.robotcode.robotcode4ij.lsp
22
3+ import com.intellij.openapi.diagnostic.thisLogger
34import com.intellij.openapi.editor.colors.TextAttributesKey
45import com.intellij.psi.PsiFile
6+ import com.redhat.devtools.lsp4ij.features.semanticTokens.DefaultSemanticTokensColorsProvider
57import com.redhat.devtools.lsp4ij.features.semanticTokens.SemanticTokensColorsProvider
68import dev.robotcode.robotcode4ij.highlighting.Colors
79
@@ -22,7 +24,8 @@ private val mapping by lazy {
2224 " testcaseName" to Colors .TESTCASE_NAME ,
2325 " keywordName" to Colors .KEYWORD_NAME ,
2426 " keywordCall" to Colors .KEYWORD_CALL ,
25-
27+ " keywordCallInner" to Colors .KEYWORD_CALL_INNER ,
28+ " nameCall" to Colors .NAME_CALL ,
2629 " argument" to Colors .ARGUMENT ,
2730 " embeddedArgument" to Colors .EMBEDDED_ARGUMENT ,
2831 " namedArgument" to Colors .NAMED_ARGUMENT ,
@@ -37,11 +40,16 @@ private val mapping by lazy {
3740 )
3841}
3942
40- class RobotCodeSemanticTokensColorsProvider : SemanticTokensColorsProvider {
43+ class RobotCodeSemanticTokensColorsProvider : DefaultSemanticTokensColorsProvider () {
4144 override fun getTextAttributesKey (
4245 tokenType : String , tokenModifiers : MutableList <String >, file : PsiFile
4346 ): TextAttributesKey ? {
44- return mapping[tokenType]
47+ val result = mapping[tokenType] ? : super .getTextAttributesKey(tokenType, tokenModifiers, file)
48+
49+ return result ? : run {
50+ thisLogger().warn(" Unknown token type: $tokenType " )
51+ null
52+ }
4553 }
4654}
4755
0 commit comments