mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable tricky cheap overriding methods search in scratches.
GitOrigin-RevId: 5923eb4070e1754da64b235e0cc0836486ec2034
This commit is contained in:
committed by
intellij-monorepo-bot
parent
078031394e
commit
6cc0a96a98
+11
@@ -3,6 +3,9 @@ package com.siyeh.ig;
|
||||
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.java.stubs.index.JavaStubIndexKeys;
|
||||
import com.intellij.psi.impl.search.JavaSourceFilterScope;
|
||||
@@ -35,6 +38,7 @@ public class JavaOverridingMethodUtil {
|
||||
public static Stream<PsiMethod> getOverridingMethodsIfCheapEnough(@NotNull PsiMethod method,
|
||||
@Nullable GlobalSearchScope searchScope,
|
||||
@NotNull Predicate<? super PsiMethod> preFilter) {
|
||||
if (!isInSourceContent(method)) return null;
|
||||
Project project = method.getProject();
|
||||
String name = method.getName();
|
||||
SearchScope useScope = method.getUseScope();
|
||||
@@ -74,4 +78,11 @@ public class JavaOverridingMethodUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isInSourceContent(@NotNull PsiElement e) {
|
||||
final VirtualFile file = e.getContainingFile().getVirtualFile();
|
||||
if (file == null) return false;
|
||||
final ProjectFileIndex index = ProjectRootManager.getInstance(e.getProject()).getFileIndex();
|
||||
return index.isInContent(file) || index.isInLibrary(file);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user