mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
IDEA-161026 Quickdoc badly shows initialization of array
This commit is contained in:
@@ -2175,7 +2175,20 @@ public class JavaDocInfoGenerator {
|
||||
if (type != null) {
|
||||
generateType(myBuffer, type, expression);
|
||||
}
|
||||
expression.acceptChildren(this);
|
||||
PsiExpression[] dimensions = expression.getArrayDimensions();
|
||||
if (dimensions.length > 0) {
|
||||
LOG.assertTrue(myBuffer.charAt(myBuffer.length() - 1) == ']');
|
||||
myBuffer.setLength(myBuffer.length() - 1);
|
||||
for (PsiExpression dimension : dimensions) {
|
||||
dimension.accept(this);
|
||||
myBuffer.append(", ");
|
||||
}
|
||||
myBuffer.setLength(myBuffer.length() - 2);
|
||||
myBuffer.append(']');
|
||||
}
|
||||
else {
|
||||
expression.acceptChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<html><head><base href="placeholder"> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://A"><code>A</code></a></b></small><PRE>public static int[] <b>x = new int[1]</b></PRE></body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
public static int[] x = new int[1];
|
||||
}
|
||||
@@ -172,6 +172,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
public void testFieldInitializedWithSizedArray() throws Exception {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
public void testEnumConstantOrdinal() throws Exception {
|
||||
PsiClass psiClass = getTestClass();
|
||||
PsiField field = psiClass.getFields() [0];
|
||||
|
||||
Reference in New Issue
Block a user