@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.psi.KtVariableDeclaration
22
22
import org.jetbrains.kotlin.psi.KtNamedDeclaration
23
23
import org.jetbrains.kotlin.psi.KtProperty
24
24
import org.jetbrains.kotlin.psi.KtParameter
25
+ import org.jetbrains.kotlin.psi.KtStringTemplateEntry
25
26
import org.jetbrains.kotlin.psi.KtStringTemplateExpression
26
27
import org.jetbrains.kotlin.resolve.BindingContext
27
28
import com.intellij.psi.PsiElement
@@ -42,7 +43,10 @@ enum class SemanticTokenType(val typeName: String) {
42
43
ENUM (SemanticTokenTypes .Enum ),
43
44
TYPE (SemanticTokenTypes .Type ),
44
45
STRING (SemanticTokenTypes .String ),
45
- NUMBER (SemanticTokenTypes .Number )
46
+ NUMBER (SemanticTokenTypes .Number ),
47
+ // Since LSP does not provide a token type for string interpolation
48
+ // entries, we use Variable as a fallback here for now
49
+ INTERPOLATION_ENTRY (SemanticTokenTypes .Variable )
46
50
}
47
51
48
52
enum class SemanticTokenModifier (val modifierName : String ) {
@@ -165,6 +169,7 @@ private fun elementToken(element: PsiElement, bindingContext: BindingContext): S
165
169
166
170
SemanticToken (identifierRange, tokenType, modifiers)
167
171
}
172
+ is KtStringTemplateEntry -> SemanticToken (elementRange, SemanticTokenType .INTERPOLATION_ENTRY )
168
173
is KtStringTemplateExpression -> SemanticToken (elementRange, SemanticTokenType .STRING )
169
174
is PsiLiteralExpression -> {
170
175
val tokenType = when (element.type) {
0 commit comments