mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
Java: render incomplete polyadic expressions correctly (IDEA-356837)
GitOrigin-RevId: 6b9de40ba5ba85a0a27a1e7e8f85150058510fc9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
539ecb5e94
commit
c014a1f2f1
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.psi.util;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
@@ -82,15 +82,13 @@ public class PsiExpressionTrimRenderer extends JavaRecursiveElementWalkingVisito
|
||||
|
||||
@Override
|
||||
public void visitPolyadicExpression(@NotNull PsiPolyadicExpression expression) {
|
||||
PsiExpression[] operands = expression.getOperands();
|
||||
for (int i = 0; i < operands.length; i++) {
|
||||
PsiExpression operand = operands[i];
|
||||
if (i != 0) {
|
||||
PsiJavaToken token = expression.getTokenBeforeOperand(operand);
|
||||
assert token != null;
|
||||
myBuf.append(" ").append(token.getText()).append(" ");
|
||||
for (PsiElement child : expression.getChildren()) {
|
||||
if (child instanceof PsiExpression) {
|
||||
child.accept(this);
|
||||
}
|
||||
else if (child instanceof PsiJavaToken) {
|
||||
myBuf.append(" ").append(child.getText()).append(" ");
|
||||
}
|
||||
operand.accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user