mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-highlighting] Use 'SetVariableTypeFix' for the "The receiver type does not match the enclosing class type" error
GitOrigin-RevId: f60f37d148c81dfe0fb86d56a385c2561ad9bb07
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c32ee0edf2
commit
475eaf4754
+17
-11
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight.intention.impl.config;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightWorkspaceSettings;
|
||||
@@ -1052,17 +1052,23 @@ public final class QuickFixFactoryImpl extends QuickFixFactory {
|
||||
@Override
|
||||
public @NotNull IntentionAction createReceiverParameterTypeFix(@NotNull PsiReceiverParameter receiverParameter,
|
||||
@NotNull PsiType enclosingClassType) {
|
||||
return new VariableTypeFix(receiverParameter, enclosingClassType) {
|
||||
@Override
|
||||
public @NotNull String getText() {
|
||||
return QuickFixBundle.message("fix.receiver.parameter.type.text");
|
||||
}
|
||||
return new ReceiverParameterTypeFix(receiverParameter, enclosingClassType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getFamilyName() {
|
||||
return QuickFixBundle.message("fix.receiver.parameter.type.family");
|
||||
}
|
||||
};
|
||||
private final static class ReceiverParameterTypeFix extends SetVariableTypeFix {
|
||||
private ReceiverParameterTypeFix(@NotNull PsiReceiverParameter receiverParameter, @NotNull PsiType enclosingClassType) {
|
||||
super(receiverParameter, enclosingClassType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getText() {
|
||||
return QuickFixBundle.message("fix.receiver.parameter.type.text");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getFamilyName() {
|
||||
return QuickFixBundle.message("fix.receiver.parameter.type.family");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user