IJPL-162806 Logging for shouldProcess highlighting method

GitOrigin-RevId: 10f06ebdcbfc0b1c72cb3df47833917530f319ae
This commit is contained in:
Alexey Kryuchkov
2024-10-01 16:57:08 +04:00
committed by intellij-monorepo-bot
parent 77a5e1bfa5
commit 36b1c6f024

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.daemon;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiFile;
import com.intellij.util.containers.ContainerUtil;
@@ -13,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
*/
public abstract class ProblemHighlightFilter {
public static final ExtensionPointName<ProblemHighlightFilter> EP_NAME = ExtensionPointName.create("com.intellij.problemHighlightFilter");
private static final Logger LOG = Logger.getInstance(ProblemHighlightFilter.class);
/**
* @param psiFile file to decide about
@@ -33,6 +35,10 @@ public abstract class ProblemHighlightFilter {
}
private static boolean shouldProcess(@NotNull PsiFile psiFile, boolean onTheFly) {
return ContainerUtil.all(EP_NAME.getExtensionList(), filter -> onTheFly ? filter.shouldHighlight(psiFile) : filter.shouldProcessInBatch(psiFile));
return ContainerUtil.all(EP_NAME.getExtensionList(), filter -> {
var shouldHighlight = onTheFly ? filter.shouldHighlight(psiFile) : filter.shouldProcessInBatch(psiFile);
LOG.debug("shouldProcess highlight: ", shouldHighlight, " filter type: ", filter.getClass().getSimpleName());
return shouldHighlight;
});
}
}