mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
always queue index update in dump mode when idea.schedule.cache.update.in.dumb.mode property is set
This commit is contained in:
+3
-18
@@ -36,8 +36,6 @@ import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.ex.VirtualFileManagerAdapter;
|
||||
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
|
||||
import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
|
||||
import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
|
||||
import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
|
||||
import com.intellij.util.SystemProperties;
|
||||
@@ -61,7 +59,6 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl {
|
||||
"idea.schedule.cache.update.in.dumb.mode", true);
|
||||
private boolean myPointerChangesDetected = false;
|
||||
private int myInsideRefresh = 0;
|
||||
private boolean myLargeVfsUpdateDetected;
|
||||
private final BatchUpdateListener myHandler;
|
||||
private final MessageBusConnection myConnection;
|
||||
|
||||
@@ -88,22 +85,10 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl {
|
||||
}
|
||||
});
|
||||
|
||||
myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener.Adapter() {
|
||||
@Override
|
||||
public void before(@NotNull List<? extends VFileEvent> events) {
|
||||
myLargeVfsUpdateDetected |= DirectoryIndexImpl.isLargeVfsChange(events);
|
||||
}
|
||||
});
|
||||
|
||||
VirtualFileManager.getInstance().addVirtualFileManagerListener(new VirtualFileManagerAdapter() {
|
||||
@Override
|
||||
public void beforeRefreshStart(boolean asynchronous) {
|
||||
myLargeVfsUpdateDetected = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterRefreshFinish(boolean asynchronous) {
|
||||
doUpdateOnRefresh(myLargeVfsUpdateDetected);
|
||||
doUpdateOnRefresh();
|
||||
}
|
||||
}, project);
|
||||
|
||||
@@ -185,7 +170,7 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl {
|
||||
getBatchSession(fileTypes).rootsChanged();
|
||||
}
|
||||
|
||||
private void doUpdateOnRefresh(boolean largeChange) {
|
||||
private void doUpdateOnRefresh() {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode() && (!myStartupActivityPerformed || myProject.isDisposed())) {
|
||||
return; // in test mode suppress addition to a queue unless project is properly initialized
|
||||
}
|
||||
@@ -193,7 +178,7 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl {
|
||||
return; // default project
|
||||
}
|
||||
DumbServiceImpl dumbService = DumbServiceImpl.getInstance(myProject);
|
||||
if (largeChange && ourScheduleCacheUpdateInDumbMode) {
|
||||
if (ourScheduleCacheUpdateInDumbMode) {
|
||||
dumbService.queueCacheUpdateInDumbMode(myRefreshCacheUpdaters);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user