highlighting: more logging in case of heavy processing running

GitOrigin-RevId: b688ff690eb905572bc5ae71958f220633061ea3
This commit is contained in:
Alexey Kudravtsev
2024-08-13 14:42:55 +02:00
committed by intellij-monorepo-bot
parent b2b55f74cd
commit 669c8df167

View File

@@ -1263,8 +1263,6 @@ public final class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx
ApplicationManager.getApplication().assertIsNonDispatchThread();
try {
ProgressManager.getInstance().executeProcessUnderProgress(Context.current().wrap(() -> {
// wait for heavy processing to stop, re-schedule daemon but not too soon
boolean heavyProcessIsRunning = heavyProcessIsRunning();
HighlightingPass[] passes = ReadAction.compute(() -> {
if (progress.isCanceled() ||
myProject.isDisposed() ||
@@ -1290,8 +1288,12 @@ public final class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx
if (passesToIgnore.length != 0) {
r = ContainerUtil.findAllAsArray(r, pass->!(pass instanceof TextEditorHighlightingPass te) || ArrayUtil.indexOf(passesToIgnore, te.getId()) == -1);
}
if (heavyProcessIsRunning) {
// wait for heavy processing to stop, re-schedule daemon but not too soon
if (heavyProcessIsRunning()) {
r = ContainerUtil.findAllAsArray(r, o -> DumbService.isDumbAware(o));
if (LOG.isDebugEnabled()) {
LOG.debug("submitInBackground: heavyProcessIsRunning=true, so only these passes are created: " + Arrays.toString(r));
}
}
return r;
}