1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-04-11 03:15:49 +02:00

Fix Fix Wrong element created by ASTFactory

This commit is contained in:
张志豪 2021-01-30 22:10:53 +08:00
parent bc4859c9b6
commit 21ab983945

View File

@ -486,7 +486,11 @@ class RainbowIndentsPass internal constructor(
val document = editor.document
val project = editor.project ?: return null
val psiFile = PsiManager.getInstance(project).findFile(virtualFile) ?: return null
var element = psiFile.findElementAt(highlighter.endOffset)?.parent ?: return null
var element = try {
psiFile.findElementAt(highlighter.endOffset)?.parent ?: return null
} catch (e: Throwable) {
return null
}
var rainbowInfo = RainbowInfo.RAINBOW_INFO_KEY[element]
if (rainbowInfo == null && psiFile is XmlFile && element !is XmlTag) {