[java-highlighting] Improve error message in IDEA-369310

Previous hasError status (after syntax error) was not reset. As a result, we did not report the next error on the surrounding element.
(cherry picked from commit 60c0be1cc6ca4967eb72e2fc24278cdc5cf2728e)
Review ID: IJ-CR-157915

GitOrigin-RevId: a44595d7b2e8fd472f6f084998901645bf29eab6
This commit is contained in:
Tagir Valeev
2025-03-18 11:01:57 +01:00
committed by intellij-monorepo-bot
parent 22abc0a29b
commit 5e8306f8c8
2 changed files with 2 additions and 1 deletions

View File

@@ -794,6 +794,7 @@ final class JavaErrorVisitor extends JavaElementVisitor {
@Override
public void visitReferenceExpression(@NotNull PsiReferenceExpression expression) {
visitElement(expression);
JavaResolveResult resultForIncompleteCode = doVisitReferenceElement(expression);
if (!hasErrorResults()) {
visitExpression(expression);

View File

@@ -1,3 +1,3 @@
// IDEA-369310
@SuppressWarnings(<error descr="Incompatible types. Found: 'null', required: 'java.lang.String[]'">"unused".</error><error descr="Identifier expected">)</error>
@SuppressWarnings(<error descr="Attribute value must be constant">"unused".</error><error descr="Identifier expected">)</error>
class X {}