diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/UpdateHighlightersUtil.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/UpdateHighlightersUtil.java index c2e94e1aa686..125f4299858e 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/UpdateHighlightersUtil.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/UpdateHighlightersUtil.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.daemon.impl; import com.intellij.codeHighlighting.Pass; @@ -475,15 +475,15 @@ public final class UpdateHighlightersUtil { private static int getLayer(@NotNull HighlightInfo info, @NotNull SeverityRegistrar severityRegistrar) { HighlightSeverity severity = info.getSeverity(); int layer; - if (severity == HighlightSeverity.WARNING) { + if (severityRegistrar.compare(severity, HighlightSeverity.ERROR) >= 0) { + layer = HighlighterLayer.ERROR; + } + else if (severityRegistrar.compare(severity, HighlightSeverity.WARNING) >= 0) { layer = HighlighterLayer.WARNING; } - else if (severity == HighlightSeverity.WEAK_WARNING) { + else if (severityRegistrar.compare(severity, HighlightSeverity.WEAK_WARNING) >= 0) { layer = HighlighterLayer.WEAK_WARNING; } - else if (severityRegistrar.compare(severity, HighlightSeverity.ERROR) >= 0) { - layer = HighlighterLayer.ERROR; - } else if (severity == HighlightInfoType.INJECTED_FRAGMENT_SEVERITY || severity == HighlightInfoType.HIGHLIGHTED_REFERENCE_SEVERITY) { layer = HighlighterLayer.CARET_ROW - 1; }