mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Skip minified javascripts when calculating duplicates
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.indexing.FileContent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -63,6 +64,10 @@ public abstract class DuplicatesProfile {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean acceptsContentForIndexing(FileContent fileContent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final int FACTOR = 2;
|
||||
private static final int MAX_COST = 7000;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class DuplicatesIndex extends FileBasedIndexExtension<Integer, TIntArrayL
|
||||
FileType type = inputData.getFileType();
|
||||
|
||||
DuplicatesProfile profile = findDuplicatesProfile(type);
|
||||
if (profile == null) return Collections.emptyMap();
|
||||
if (profile == null || !profile.acceptsContentForIndexing(inputData)) return Collections.emptyMap();
|
||||
|
||||
try {
|
||||
FileContentImpl fileContent = (FileContentImpl)inputData;
|
||||
|
||||
Reference in New Issue
Block a user