mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RUBY-15932: let's limit number of line extensions we paint
in case we have too many extensions IDE is almost hanging on painting
This commit is contained in:
+5
-1
@@ -50,6 +50,10 @@ import java.util.List;
|
||||
*/
|
||||
public class XDebuggerEditorLinePainter extends EditorLinePainter {
|
||||
public static final Key<Map<Variable, VariableValue>> CACHE = Key.create("debug.inline.variables.cache");
|
||||
// we want to limit number of line extentions to avoid very slow painting
|
||||
// the constant is rather random (feel free to adjust it upon getting a new information)
|
||||
private static final int LINE_EXTENTIONS_MAX_COUNT = 200;
|
||||
|
||||
@Override
|
||||
public Collection<LineExtensionInfo> getLineExtensions(@NotNull Project project, @NotNull VirtualFile file, int lineNumber) {
|
||||
if (!Registry.is("ide.debugger.inline")) {
|
||||
@@ -142,7 +146,7 @@ public class XDebuggerEditorLinePainter extends EditorLinePainter {
|
||||
for (VariableText text : result) {
|
||||
infos.addAll(text.infos);
|
||||
}
|
||||
return infos;
|
||||
return infos.size() > LINE_EXTENTIONS_MAX_COUNT ? infos.subList(0, LINE_EXTENTIONS_MAX_COUNT) : infos;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user