From cd385e6c46d8be3abbe669ef3d8dd88fea375042 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 5 Sep 2016 22:15:46 +0200 Subject: [PATCH] InjectionCache: return to searching in java files only until Kotlin improves performance --- .../plugins/intelliLang/inject/java/InjectionCache.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/InjectionCache.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/InjectionCache.java index d795589532f0..e1c5213840a0 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/InjectionCache.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/InjectionCache.java @@ -15,6 +15,7 @@ */ package org.intellij.plugins.intelliLang.inject.java; +import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import com.intellij.patterns.ElementPattern; @@ -68,6 +69,10 @@ public class InjectionCache { @NotNull private Set collectMethodNamesWithLanguage(String annotationClassName) { GlobalSearchScope allScope = GlobalSearchScope.allScope(myProject); + + // todo remove once Kotlin support becomes fast enough (https://youtrack.jetbrains.com/issue/KT-13734) + allScope = GlobalSearchScope.getScopeRestrictedByFileTypes(allScope, JavaFileType.INSTANCE); + Set result = new THashSet<>(); ArrayList annoClasses = ContainerUtil.newArrayList(JavaPsiFacade.getInstance(myProject).findClasses(annotationClassName, allScope)); for (int cursor = 0; cursor < annoClasses.size(); cursor++) {