diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerReferenceReader.java b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java similarity index 97% rename from java/compiler/impl/src/com/intellij/compiler/CompilerReferenceReader.java rename to java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java index 47edd0c7b13f..995ae637a853 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerReferenceReader.java +++ b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceReader.java @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.compiler; +package com.intellij.compiler.backwardRefs; -import com.intellij.compiler.backwardRefs.LanguageLightUsageConverter; +import com.intellij.compiler.ClassResolvingCompilerSearchAdapter; +import com.intellij.compiler.CompilerElement; +import com.intellij.compiler.CompilerSearchAdapter; import com.intellij.compiler.server.BuildManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileTypes.FileType; @@ -28,7 +30,6 @@ import com.intellij.psi.PsiNamedElement; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.util.ObjectUtils; import com.intellij.util.SmartList; -import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Queue; import com.sun.tools.javac.util.Convert; import gnu.trove.THashMap; @@ -42,7 +43,6 @@ import org.jetbrains.jps.backwardRefs.LightUsage; import java.io.File; import java.io.IOException; import java.util.*; -import java.util.stream.Stream; import static java.util.stream.Collectors.*; diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerReferenceServiceImpl.java b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceImpl.java similarity index 98% rename from java/compiler/impl/src/com/intellij/compiler/CompilerReferenceServiceImpl.java rename to java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceImpl.java index ee8f364c07ae..9900e1fd8125 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerReferenceServiceImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceImpl.java @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.compiler; +package com.intellij.compiler.backwardRefs; -import com.intellij.compiler.backwardRefs.LanguageLightUsageConverter; +import com.intellij.compiler.ClassResolvingCompilerSearchAdapter; +import com.intellij.compiler.CompilerElement; +import com.intellij.compiler.CompilerReferenceService; +import com.intellij.compiler.CompilerSearchAdapter; import com.intellij.compiler.server.BuildManager; import com.intellij.compiler.server.BuildManagerListener; import com.intellij.lang.injection.InjectedLanguageManager; @@ -243,7 +246,7 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple } private boolean isServiceEnabledFor(PsiElement element) { - return isServiceEnabled() && InjectedLanguageManager.getInstance(myProject).isInjectedFragment(ReadAction.compute(() -> element.getContainingFile())); + return isServiceEnabled() && !InjectedLanguageManager.getInstance(myProject).isInjectedFragment(ReadAction.compute(() -> element.getContainingFile())); } private boolean isServiceEnabled() { diff --git a/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesTest.java b/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesTest.java index 7cfe4c2bb450..e7d5c8a95c1e 100644 --- a/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesTest.java +++ b/java/java-tests/testSrc/com/intellij/compiler/CompilerReferencesTest.java @@ -17,6 +17,7 @@ package com.intellij.compiler; import com.intellij.JavaTestUtil; import com.intellij.codeInsight.completion.AbstractCompilerAwareTest; +import com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.java.LanguageLevel; diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index 405fb123613e..d0b992ca5e6d 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -77,7 +77,7 @@ com.intellij.compiler.CompilerReferenceService - com.intellij.compiler.CompilerReferenceServiceImpl + com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl