use of com.intellij.openapi.roots.impl.FilePropertyPusher in project intellij-community by JetBrains.
the class HighlightUtil method getUnsupportedFeatureMessage.
private static String getUnsupportedFeatureMessage(PsiElement element, Feature feature, LanguageLevel level, PsiFile file) {
String name = JavaErrorMessages.message(feature.key);
String message = JavaErrorMessages.message("insufficient.language.level", name, level.getCompilerComplianceDefaultOption());
Module module = ModuleUtilCore.findModuleForPsiElement(element);
if (module != null) {
LanguageLevel moduleLanguageLevel = EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(module);
if (moduleLanguageLevel.isAtLeast(feature.level)) {
for (FilePropertyPusher pusher : FilePropertyPusher.EP_NAME.getExtensions()) {
if (pusher instanceof JavaLanguageLevelPusher) {
String newMessage = ((JavaLanguageLevelPusher) pusher).getInconsistencyLanguageLevelMessage(message, element, level, file);
if (newMessage != null) {
return newMessage;
}
}
}
}
}
return message;
}
Aggregations