Workaround copied kotlin element happened to be outside the KtFile

Can be reproduced after revert with
IdeLightClassTestGenerated$Local.testDollarsInNameLocal test.
This commit is contained in:
Nikolay Krasko
2019-07-31 19:58:47 +03:00
committed by Nikolay Krasko
parent 5614afed14
commit 83e422fc3b
2 changed files with 8 additions and 4 deletions
@@ -35,9 +35,12 @@ open class KtLightClassForLocalDeclaration(
KotlinClassInnerStuffCache(
this,
with(KotlinModificationTrackerService.getInstance(classOrObject.project)) {
listOf(
outOfBlockModificationTracker, fileModificationTracker(classOrObject.containingKtFile)
)
val file = classOrObject.containingFile
if (file is KtFile) {
listOf(outOfBlockModificationTracker, fileModificationTracker(file))
} else {
listOf(outOfBlockModificationTracker)
}
}
)