Skip to content

Commit c9b34e4

Browse files
raghucssitiloveeclipse
authored andcommitted
Improve 'Replace All' performance.
For Large Java file 'Replace All' takes long time and freezes the UI. One of the reason is Projection Model tries to iterate over all the Projection Annotations to expand/collapse status. We can improve this situation by using Region specific iterator. This returns annotations which are enclosed by given offset. This improves the performance by 25% at least. See #2257
1 parent 70a2d11 commit c9b34e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected boolean expandAll(int offset, int length, boolean fireModelChanged) {
149149

150150
boolean expanding= false;
151151

152-
Iterator<Annotation> iterator= getAnnotationIterator();
152+
Iterator<Annotation> iterator= getAnnotationIterator(offset, length, true, true);
153153
while (iterator.hasNext()) {
154154
ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
155155
if (annotation.isCollapsed()) {

0 commit comments

Comments
 (0)