mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Use configurable property to skip large files during search (IDEA-72543)
To determine file to be skipped by file search existing (user-configurable) property FileUtilRt.LARGE_FOR_CONTENT_LOADING is used r=Peter.Gromov
This commit is contained in:
@@ -38,6 +38,7 @@ import com.intellij.openapi.project.ProjectUtil;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.text.TrigramBuilder;
|
||||
@@ -78,7 +79,6 @@ class FindInProjectTask {
|
||||
.thenComparing(VirtualFile::getPath);
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.find.impl.FindInProjectTask");
|
||||
private static final int FILES_SIZE_LIMIT = 70 * 1024 * 1024; // megabytes.
|
||||
private static final int SINGLE_FILE_SIZE_LIMIT = 5 * 1024 * 1024; // megabytes.
|
||||
private final FindModel myFindModel;
|
||||
private final Project myProject;
|
||||
private final PsiManager myPsiManager;
|
||||
@@ -197,7 +197,7 @@ class FindInProjectTask {
|
||||
final boolean skipProjectFile = ProjectUtil.isProjectOrWorkspaceFile(virtualFile) && !myFindModel.isSearchInProjectFiles();
|
||||
if (skipProjectFile && !Registry.is("find.search.in.project.files")) return true;
|
||||
|
||||
if (fileLength > SINGLE_FILE_SIZE_LIMIT) {
|
||||
if (fileLength > FileUtilRt.LARGE_FOR_CONTENT_LOADING) {
|
||||
myLargeFiles.add(virtualFile);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user