mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[java-completion] IJ-CR-124074 IDEA-342465 support correctness for completion
- Allow running highlighting on the copy of the file. Add comments GitOrigin-RevId: c568202e7b1462834ab70fbdb1c3bd0bac448c92
This commit is contained in:
committed by
intellij-monorepo-bot
parent
70ecc55cab
commit
897bfa4e1c
@@ -553,8 +553,13 @@ public abstract class QuickFixFactory {
|
||||
|
||||
public abstract @NotNull IntentionAction createDeleteSwitchLabelFix(@NotNull PsiCaseLabelElement labelElement);
|
||||
|
||||
/**
|
||||
* @return The IntentionAction that performs the deletion of the default element.
|
||||
* Returns null if the fix cannot be created
|
||||
* (for example, if the file is not physical, it can happen when highlighting is run on the copy of the file).
|
||||
*/
|
||||
@Nullable
|
||||
public abstract IntentionAction createDeleteDefaultFix(@NotNull PsiFile file, @NotNull PsiElement duplicateElement);
|
||||
public abstract IntentionAction createDeleteDefaultFix(@NotNull PsiFile file, @NotNull PsiElement defaultElement);
|
||||
|
||||
public abstract @NotNull IntentionAction createAddAnnotationTargetFix(@NotNull PsiAnnotation annotation, PsiAnnotation.TargetType target);
|
||||
|
||||
|
||||
@@ -1124,10 +1124,10 @@ public final class QuickFixFactoryImpl extends QuickFixFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IntentionAction createDeleteDefaultFix(@NotNull PsiFile file, @NotNull PsiElement duplicateElement) {
|
||||
public @Nullable IntentionAction createDeleteDefaultFix(@NotNull PsiFile file, @NotNull PsiElement defaultElement) {
|
||||
if(!file.isPhysical()) return null;
|
||||
ProblemDescriptor descriptor =
|
||||
new ProblemDescriptorBase(duplicateElement, duplicateElement, "", null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false, null,
|
||||
new ProblemDescriptorBase(defaultElement, defaultElement, "", null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false, null,
|
||||
false, false);
|
||||
return QuickFixWrapper.wrap(descriptor, new UnnecessaryDefaultInspection.DeleteDefaultFix());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user