Revert "IJ-CR-134196 [java-highlighting] IDEA-352727 Incomplete model with lombok"

This reverts commit 1c5fc12a0f4dd70c8899a807dc03925680c68ab9.

GitOrigin-RevId: dd3bcd03cf5dd5d1b3ef8958805579283cbcca37
This commit is contained in:
Mikhail Pyltsin
2024-05-24 11:57:51 +02:00
committed by intellij-monorepo-bot
parent 7e047434f3
commit 41c184cc13
5 changed files with 13 additions and 23 deletions

View File

@@ -287,7 +287,7 @@ public final class HighlightControlFlowUtil {
if (isFieldInitializedAfterObjectConstruction(field)) return null;
if (PsiUtilCore.hasErrorElementChild(field)) return null;
if (IncompleteModelUtil.isIncompleteModel(field) && IncompleteModelUtil.canBeAugmented(field.getContainingClass())) {
return IncompleteModelUtil.getPendingInitizializingHighlightInfo(field);
return IncompleteModelUtil.getPendingReferenceHighlightInfo(field);
}
String description = JavaErrorBundle.message("variable.not.initialized", field.getName());
TextRange range = HighlightNamesUtil.getFieldDeclarationTextRange(field);

View File

@@ -280,22 +280,13 @@ final class IncompleteModelUtil {
.descriptionAndTooltip(JavaErrorBundle.message("incomplete.project.state.pending.reference"));
}
/**
* @param elementToHighlight element to attach the highlighting
* @return HighlightInfo builder that adds a pending initizializing highlight
*/
static HighlightInfo.@NotNull Builder getPendingInitizializingHighlightInfo(@NotNull PsiElement elementToHighlight) {
return HighlightInfo.newHighlightInfo(HighlightInfoType.PENDING_REFERENCE).range(elementToHighlight)
.descriptionAndTooltip(JavaErrorBundle.message("incomplete.project.state.pending.initalizing"));
}
static boolean canBeAugmented(@Nullable PsiClass targetClass) {
if (targetClass == null) return false;
return CachedValuesManager.getProjectPsiDependentCache(targetClass,
psiClass -> PsiAugmentProvider.canBeAugmentedForIncompleteMode(psiClass));
}
private static boolean canBeUsedImportImplicitly(@Nullable PsiImportStatementBase importStatementBase) {
static boolean canBeUsedImportImplicitly(@Nullable PsiImportStatementBase importStatementBase) {
if (importStatementBase == null) return false;
return PsiAugmentProvider.canBeUsedImportForIncompleteMode(importStatementBase);
}

View File

@@ -598,4 +598,3 @@ error.package.statement.not.allowed.for.implicit.class=Package statement is not
error.initializers.are.not.allowed.in.implicit.classes=Initializers are not allowed in implicitly declared classes
remove.unused.imports.quickfix.text=Remove unused imports
incomplete.project.state.pending.reference=Not resolved until the project is fully loaded
incomplete.project.state.pending.initalizing=Not initialized until the project is fully loaded

View File

@@ -14,15 +14,15 @@ public final class LombokBasics {
@<info descr="Not resolved until the project is fully loaded">Getter</info>
@<info descr="Not resolved until the project is fully loaded">SuperBuilder</info>
class UserDao extends UserId {
<info descr="Not initialized until the project is fully loaded">private final String name;</info>
<info descr="Not initialized until the project is fully loaded">private final String surname;</info>
<info descr="Not initialized until the project is fully loaded">private final String email;</info>
<info descr="Not resolved until the project is fully loaded">private final String name;</info>
<info descr="Not resolved until the project is fully loaded">private final String surname;</info>
<info descr="Not resolved until the project is fully loaded">private final String email;</info>
}
@<info descr="Not resolved until the project is fully loaded">SuperBuilder</info>
abstract class UserId {
<info descr="Not initialized until the project is fully loaded">private final long id;</info>
<info descr="Not initialized until the project is fully loaded">private final String info;</info>
<info descr="Not resolved until the project is fully loaded">private final long id;</info>
<info descr="Not resolved until the project is fully loaded">private final String info;</info>
}
class UserChain {

View File

@@ -16,15 +16,15 @@ public final class LombokBasicsWithExplicitImport {
@<info descr="Not resolved until the project is fully loaded">Getter</info>
@<info descr="Not resolved until the project is fully loaded">SuperBuilder</info>
class UserDao extends UserId {
<info descr="Not initialized until the project is fully loaded">private final String name;</info>
<info descr="Not initialized until the project is fully loaded">private final String surname;</info>
<info descr="Not initialized until the project is fully loaded">private final String email;</info>
<info descr="Not resolved until the project is fully loaded">private final String name;</info>
<info descr="Not resolved until the project is fully loaded">private final String surname;</info>
<info descr="Not resolved until the project is fully loaded">private final String email;</info>
}
@<info descr="Not resolved until the project is fully loaded">SuperBuilder</info>
abstract class UserId {
<info descr="Not initialized until the project is fully loaded">private final long id;</info>
<info descr="Not initialized until the project is fully loaded">private final String info;</info>
<info descr="Not resolved until the project is fully loaded">private final long id;</info>
<info descr="Not resolved until the project is fully loaded">private final String info;</info>
}
class UserChain {