mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
[java-highlighting] Don't suggest moving 'this' to the beginning of the list if there is already a receiver there
GitOrigin-RevId: d474d72a0fa00912a65f7ed32a85f2c2deec5e44
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eeb345a0d7
commit
02e34802cf
@@ -763,7 +763,10 @@ public final class AnnotationsHighlightUtil {
|
||||
String text = JavaErrorBundle.message("receiver.wrong.position");
|
||||
HighlightInfo info =
|
||||
HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(parameter.getIdentifier()).descriptionAndTooltip(text).create();
|
||||
QuickFixAction.registerQuickFixAction(info, new MakeReceiverParameterFirstFix(parameter));
|
||||
PsiReceiverParameter firstReceiverParameter = PsiTreeUtil.getChildOfType(method.getParameterList(), PsiReceiverParameter.class);
|
||||
if (!PsiUtil.isJavaToken(PsiTreeUtil.skipWhitespacesAndCommentsBackward(firstReceiverParameter), JavaTokenType.LPARENTH)) {
|
||||
QuickFixAction.registerQuickFixAction(info, new MakeReceiverParameterFirstFix(parameter));
|
||||
}
|
||||
QuickFixAction.registerQuickFixAction(info, QUICK_FIX_FACTORY.createDeleteFix(parameter));
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Move 'this' to the beginning of the list" "false"
|
||||
class X {
|
||||
void foo(X this, int i, X this<caret>) {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Move 'this' to the beginning of the list" "false"
|
||||
class X {
|
||||
void foo(X this, X this<caret>) {}
|
||||
}
|
||||
Reference in New Issue
Block a user