From 669c8df167245e6f468cfff9b3c5a7fc143dc4c3 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 13 Aug 2024 14:42:55 +0200 Subject: [PATCH] highlighting: more logging in case of heavy processing running GitOrigin-RevId: b688ff690eb905572bc5ae71958f220633061ea3 --- .../codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java index 152d3140de0b..8e6dfaa6f60e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java @@ -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; }