mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
stop daemon while showing file structure
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.structureView.StructureViewModel;
|
||||
@@ -115,6 +117,7 @@ public class FileStructurePopup implements Disposable {
|
||||
private String myTestSearchFilter;
|
||||
private final ActionCallback myTreeHasBuilt = new ActionCallback();
|
||||
private boolean myInitialNodeIsLeaf;
|
||||
private final boolean myDaemonUpdateEnabled;
|
||||
|
||||
public FileStructurePopup(StructureViewModel structureViewModel,
|
||||
@Nullable Editor editor,
|
||||
@@ -123,6 +126,16 @@ public class FileStructurePopup implements Disposable {
|
||||
final boolean applySortAndFilter) {
|
||||
myProject = project;
|
||||
myEditor = editor;
|
||||
|
||||
//Stop code analyzer to speedup EDT
|
||||
final DaemonCodeAnalyzer analyzer = DaemonCodeAnalyzer.getInstance(myProject);
|
||||
if (analyzer != null) {
|
||||
myDaemonUpdateEnabled = ((DaemonCodeAnalyzerImpl)analyzer).isUpdateByTimerEnabled();
|
||||
analyzer.setUpdateByTimerEnabled(false);
|
||||
} else {
|
||||
myDaemonUpdateEnabled = false;
|
||||
}
|
||||
|
||||
IdeFocusManager.getInstance(myProject).typeAheadUntil(myTreeHasBuilt);
|
||||
myBaseTreeModel = structureViewModel;
|
||||
Disposer.register(this, auxDisposable);
|
||||
@@ -398,6 +411,10 @@ public class FileStructurePopup implements Disposable {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
final DaemonCodeAnalyzer analyzer = DaemonCodeAnalyzer.getInstance(myProject);
|
||||
if (analyzer != null) {
|
||||
analyzer.setUpdateByTimerEnabled(myDaemonUpdateEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
protected static String getDimensionServiceKey() {
|
||||
|
||||
Reference in New Issue
Block a user