leave older ModuleRootListener for compatibility (IDEA-297717)

GitOrigin-RevId: b6428fd3a2e27c4917d8a9067ef4f2eb0c5ceece
This commit is contained in:
Eugene Zhuravlev
2022-07-11 13:40:08 +02:00
committed by intellij-monorepo-bot
parent 659f7a9305
commit 90ffc6dc71

View File

@@ -2,6 +2,7 @@
package com.intellij.compiler.server;
import com.intellij.DynamicBundle;
import com.intellij.ProjectTopics;
import com.intellij.application.options.RegistryManager;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.CompilerConfigurationImpl;
@@ -55,10 +56,7 @@ import com.intellij.openapi.project.*;
import com.intellij.openapi.projectRoots.*;
import com.intellij.openapi.projectRoots.ex.JavaSdkUtil;
import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl;
import com.intellij.openapi.roots.GeneratedSourcesFilter;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.startup.StartupActivity;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.io.FileUtil;
@@ -1939,6 +1937,19 @@ public final class BuildManager implements Disposable {
return entity != null? entity : change.getOldEntity();
}
});
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(@NotNull ModuleRootEvent event) {
if (!event.isCausedByWorkspaceModelChangesOnly()) {
// only process events that are not covered by events from workspace model
final Object source = event.getSource();
if (source instanceof Project) {
getInstance().clearState((Project)source);
}
}
}
});
}
connection.subscribe(ExecutionManager.EXECUTION_TOPIC, new ExecutionListener() {
@Override