From d6a9a499685f3ab16a89235e0d70d155d333a475 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 26 Jul 2017 17:14:38 +0200 Subject: [PATCH] Disable tracking of Kotlin files by Java OOCB listener --- .../frontend/src/org/jetbrains/kotlin/psi/KtFile.java | 8 +++++++- .../outOfBlock/InSuperTypeCallInLambdaParameters.kt | 5 +---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFile.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFile.java index 086700d90fb..226b5b3a406 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFile.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFile.java @@ -43,7 +43,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -public class KtFile extends PsiFileBase implements KtDeclarationContainer, KtAnnotated, KtElement, PsiClassOwner, PsiNamedElement { +public class KtFile extends PsiFileBase implements KtDeclarationContainer, KtAnnotated, KtElement, PsiClassOwner, PsiNamedElement, PsiModifiableCodeBlock { private final boolean isCompiled; private Boolean isScript = null; @@ -294,4 +294,10 @@ public class KtFile extends PsiFileBase implements KtDeclarationContainer, KtAnn public KtElement getPsiOrParent() { return this; } + + @Override + public boolean shouldChangeModificationCount(PsiElement place) { + // Modification count for Kotlin files is tracked entirely by KotlinCodeBlockModificationListener + return false; + } } diff --git a/idea/testData/codeInsight/outOfBlock/InSuperTypeCallInLambdaParameters.kt b/idea/testData/codeInsight/outOfBlock/InSuperTypeCallInLambdaParameters.kt index b179bc4e3fd..63e2fe74e9c 100644 --- a/idea/testData/codeInsight/outOfBlock/InSuperTypeCallInLambdaParameters.kt +++ b/idea/testData/codeInsight/outOfBlock/InSuperTypeCallInLambdaParameters.kt @@ -1,10 +1,7 @@ -// TRUE -// Can't result to false as there's no body expression, so it's considered to be changes in JavaCodeBlockModificationListener. +// FALSE open class A(a: () -> Unit) { constructor(f: (String) -> Unit) : this({ -> f("") }) } class B: A({ s -> "1" }) - -// SKIP_ANALYZE_CHECK \ No newline at end of file