1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-04-10 18:15:50 +02:00

Fix kotlin labeled expression highlighting.

This commit is contained in:
Yii.Guxing 2018-07-10 00:28:22 +08:00
parent c61553207b
commit 5455dba864

View File

@ -7,8 +7,10 @@ import com.intellij.lang.annotation.Annotator
import com.intellij.openapi.editor.markup.EffectType
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.ui.JBColor
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import java.awt.Font
@ -27,6 +29,10 @@ class KotlinLabelAnnotator : Annotator {
var refElement: PsiElement?
when (element) {
is KtLabelReferenceExpression -> {
if ((element.lastChild as? LeafPsiElement)?.elementType == KtTokens.AT) {
return
}
target = element
refElement = try {
element.reference?.resolve()