FIR IDE: consider modification in invalid PSI as OOBM

This commit is contained in:
Ilya Kirillov
2020-12-21 13:27:28 +01:00
parent d06a5fb413
commit 8a17a16ee2
@@ -105,6 +105,12 @@ internal class KotlinFirModificationTrackerService(project: Project) : Disposabl
private fun isOutOfBlockChange(node: ASTNode): Boolean {
val psi = node.psi ?: return true
if (!psi.isValid) {
/**
* If PSI is not valid, well something bad happened, OOBM won't hurt
*/
return true
}
val container = psi.getNonLocalContainingInBodyDeclarationWith() ?: return true
return !FileElementFactory.isReanalyzableContainer(container)
}