From eca0346bec942f8ce976fce0c8a05f2d291c3e9f Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 2 May 2019 10:42:31 +0200 Subject: [PATCH] don't load VirtualFile content twice during Find Usages there's no need to cache it in VFS, since it's already indexed and cached GitOrigin-RevId: f61dbf62b26b681741992c35ff9c069b9540c501 --- .../intellij/psi/impl/search/PsiSearchHelperImpl.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 730cc3a45a13..de7629d31eb7 100644 --- a/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -11,7 +11,6 @@ import com.intellij.openapi.application.ex.ApplicationEx; import com.intellij.openapi.application.ex.ApplicationUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.*; import com.intellij.openapi.progress.impl.CoreProgressManager; import com.intellij.openapi.progress.util.TooManyUsagesStatus; @@ -44,7 +43,6 @@ import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -396,15 +394,6 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { @NotNull final AtomicBoolean stopped) throws ApplicationUtil.CannotRunReadActionException { final PsiFile file = ApplicationUtil.tryRunReadAction(() -> vfile.isValid() ? myManager.findFile(vfile) : null); if (file != null && !(file instanceof PsiBinaryFile)) { - // load contents outside read action - if (FileDocumentManager.getInstance().getCachedDocument(vfile) == null) { - // cache bytes in vfs - try { - vfile.contentsToByteArray(); - } - catch (IOException ignored) { - } - } ApplicationUtil.tryRunReadAction(() -> { final Project project = myManager.getProject(); if (project.isDisposed()) throw new ProcessCanceledException();