mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
SSR: match multiple fields declared in single declaration correctly in incomplete code (IDEA-CR-4531)
This commit is contained in:
+3
-1
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
public class DeclarationStatementHandler extends MatchingHandler {
|
||||
private MatchingHandler myCommentHandler;
|
||||
|
||||
@Override
|
||||
public boolean match(PsiElement patternNode, PsiElement matchedNode, MatchContext context) {
|
||||
if (patternNode instanceof PsiComment) {
|
||||
return myCommentHandler.match(patternNode, matchedNode, context);
|
||||
@@ -59,7 +60,7 @@ public class DeclarationStatementHandler extends MatchingHandler {
|
||||
node = PsiTreeUtil.skipSiblingsForward(node, PsiWhiteSpace.class);
|
||||
while (PsiUtil.isJavaToken(node, JavaTokenType.COMMA)) {
|
||||
node = PsiTreeUtil.skipSiblingsForward(node, PsiWhiteSpace.class);
|
||||
if (node != null) {
|
||||
if (node instanceof PsiField) {
|
||||
matchNodes.add(node);
|
||||
}
|
||||
node = PsiTreeUtil.skipSiblingsForward(node, PsiWhiteSpace.class);
|
||||
@@ -89,6 +90,7 @@ public class DeclarationStatementHandler extends MatchingHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAdvanceTheMatchFor(PsiElement patternElement, PsiElement matchedElement) {
|
||||
if (patternElement instanceof PsiComment &&
|
||||
( matchedElement instanceof PsiField ||
|
||||
|
||||
Reference in New Issue
Block a user