mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added option idea.max.content.load.filesize to open big files without intelligence IDEA-164785
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user