mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[java-highlighting] IDEA-357214 'Module' is highlighted as an error when module name is expected
GitOrigin-RevId: c7ca9de1821e79b96a05ab74a3cbad7052ceb827
This commit is contained in:
committed by
intellij-monorepo-bot
parent
59cadbb09a
commit
7e9f1978a2
@@ -3537,6 +3537,20 @@ public final class HighlightUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
//do not highlight module keyword if the statement is not complete
|
||||
//see com.intellij.lang.java.parser.BasicFileParser.parseImportStatement
|
||||
if (PsiKeyword.MODULE.equals(ref.getText()) && refParent instanceof PsiImportStatement &&
|
||||
PsiUtil.isAvailable(JavaFeature.MODULE_IMPORT_DECLARATIONS, ref)) {
|
||||
PsiElement importKeywordExpected = PsiTreeUtil.skipWhitespacesAndCommentsBackward(ref);
|
||||
PsiElement errorElementExpected = PsiTreeUtil.skipWhitespacesAndCommentsForward(ref);
|
||||
if (importKeywordExpected instanceof PsiKeyword keyword &&
|
||||
keyword.textMatches(PsiKeyword.IMPORT) &&
|
||||
errorElementExpected instanceof PsiErrorElement errorElement &&
|
||||
JavaPsiBundle.message("expected.identifier.or.semicolon").equals(errorElement.getErrorDescription())) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
JavaResolveResult[] results = ref.multiResolve(true);
|
||||
String description;
|
||||
if (results.length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user