From 838b4c98cde21b4241aea1b9d67b78724fbf652e Mon Sep 17 00:00:00 2001 From: Sebastian Thomschke Date: Sat, 9 Mar 2024 12:14:33 +0100 Subject: [PATCH] Support limiting the number of outline symbols to avoid UI freezes (#704) --- .../org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java index 51dd6b8c0..823cf32fa 100644 --- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java +++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java @@ -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 { @@ -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;