Skip to content

Commit

Permalink
Support limiting the number of outline symbols to avoid UI freezes (#704
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sebthom authored Mar 9, 2024
1 parent 31780c6 commit 838b4c9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.eclipse.ui.navigator.ICommonContentProvider;
import org.eclipse.ui.progress.PendingUpdateAdapter;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.views.WorkbenchViewerSetup;

public class LSSymbolsContentProvider implements ICommonContentProvider, ITreeContentProvider {

Expand Down Expand Up @@ -256,6 +257,10 @@ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}

this.viewer = (TreeViewer) viewer;

// this enables limiting the number of outline entries to mitigate UI freezes
WorkbenchViewerSetup.setupViewer(this.viewer);

isQuickOutline = Boolean.TRUE.equals(viewer.getData(VIEWER_PROPERTY_IS_QUICK_OUTLINE));

outlineViewerInput = (OutlineViewerInput) newInput;
Expand Down

0 comments on commit 838b4c9

Please sign in to comment.