[java, highlighting] Fix module conflict highlighting for exported packages IDEA-352819

GitOrigin-RevId: d4479fb863280674ae8960c930e6e8b1628b7321
This commit is contained in:
Aleksey Dobrynin
2024-09-12 16:28:26 +03:00
committed by intellij-monorepo-bot
parent 25cb51da31
commit f590114d83
3 changed files with 21 additions and 5 deletions

View File

@@ -80,9 +80,14 @@ final class ModuleHighlightUtil {
if (rootForFile != null && JavaCompilerConfigurationProxy.isPatchedModuleRoot(anotherJavaModule.getName(), module, rootForFile)) {
return null;
}
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
.range(reference)
.descriptionAndTooltip(JavaErrorBundle.message("module.conflicting.packages", pack.getName(), anotherJavaModule.getName()));
for (PsiPackageAccessibilityStatement export : anotherJavaModule.getExports()) {
String exportPackageName = export.getPackageName();
if (exportPackageName != null && exportPackageName.equals(pack.getQualifiedName())) {
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
.range(reference)
.descriptionAndTooltip(JavaErrorBundle.message("module.conflicting.packages", pack.getQualifiedName(), anotherJavaModule.getName()));
}
}
}
}
}