Added option idea.max.content.load.filesize to open big files without intelligence IDEA-164785

This commit is contained in:
Alexander Kass
2016-12-08 09:29:38 +03:00
parent a1a71035a0
commit 60f3999ae3
2 changed files with 15 additions and 1 deletions
+5
View File
@@ -30,6 +30,11 @@
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500
#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=20000
#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
@@ -44,7 +44,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class FileUtilRt {
private static final int KILOBYTE = 1024;
public static final int MEGABYTE = KILOBYTE * KILOBYTE;
public static final int LARGE_FOR_CONTENT_LOADING = Math.max(20 * MEGABYTE, getUserFileSizeLimit());
public static final int LARGE_FOR_CONTENT_LOADING = Math.max(20 * MEGABYTE, Math.max(getUserFileSizeLimit(), getUserContentLoadLimit()));
private static final int MAX_FILE_IO_ATTEMPTS = 10;
private static final boolean USE_FILE_CHANNELS = "true".equalsIgnoreCase(System.getProperty("idea.fs.useChannels"));
@@ -867,6 +867,15 @@ public class FileUtilRt {
}
}
public static int getUserContentLoadLimit() {
try {
return Integer.parseInt(System.getProperty("idea.max.content.load.filesize")) * KILOBYTE;
}
catch (NumberFormatException e) {
return 20 * MEGABYTE;
}
}
private interface CharComparingStrategy {
CharComparingStrategy IDENTITY = new CharComparingStrategy() {
public boolean charsEqual(char ch1, char ch2) {