mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
java: allow comments before receiver parameter (IDEA-245721)
GitOrigin-RevId: 98f193dcd8836321639b647693156315b4bced83
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c887211a58
commit
cc9907aee7
@@ -668,7 +668,7 @@ public class AnnotationsHighlightUtil {
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(parameter.getIdentifier()).descriptionAndTooltip(text).create();
|
||||
}
|
||||
|
||||
PsiElement leftNeighbour = PsiTreeUtil.skipWhitespacesBackward(parameter);
|
||||
PsiElement leftNeighbour = PsiTreeUtil.skipWhitespacesAndCommentsBackward(parameter);
|
||||
if (leftNeighbour != null && !PsiUtil.isJavaToken(leftNeighbour, JavaTokenType.LPARENTH)) {
|
||||
String text = JavaErrorBundle.message("receiver.wrong.position");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(parameter.getIdentifier()).descriptionAndTooltip(text).create();
|
||||
|
||||
@@ -22,6 +22,8 @@ class C {
|
||||
void m1b(<error descr="'@A' not applicable to type use">@A</error> C this) { }
|
||||
|
||||
void m2(@TA Object other, @TA C <error descr="The receiver should be the first parameter">this</error>) { }
|
||||
void m2b(//comment
|
||||
@TA C this) { }
|
||||
|
||||
void m3a(@TA <error descr="The receiver type does not match the enclosing class type">Object</error> this) { }
|
||||
void m3b(@TA <error descr="The receiver type does not match the enclosing class type">int</error> this) { }
|
||||
|
||||
Reference in New Issue
Block a user