fixed EA-48905 - SIOOBE: ParameterInfoComponent$OneLineComponent.buildLabelText

This commit is contained in:
Ekaterina Tuzova
2013-09-23 19:23:43 +04:00
parent e164e63316
commit 2cd2f53f91
3 changed files with 15 additions and 1 deletions
@@ -150,7 +150,7 @@ public class PyParameterInfoHandler implements ParameterInfoHandler<PyArgumentLi
EnumSet[] flags = new EnumSet[hintFlags.size()];
for (int i = 0; i < flags.length; i += 1) flags[i] = hintFlags.get(i);
if (hints.length < 1) {
hints = new String[]{XmlStringUtil.escapeString(NO_PARAMS_MSG)};
hints = new String[]{NO_PARAMS_MSG};
flags = new EnumSet[]{EnumSet.of(ParameterInfoUIContextEx.Flag.DISABLE)};
}
@@ -0,0 +1,9 @@
def function(param, param1):
pass
def result():
pass
function(result<arg1>(), result())
@@ -385,6 +385,11 @@ public class PyParameterInfoTest extends LightMarkedTestCase {
feignCtrlP(marks.get("<arg1>").getTextOffset()).check("a, b, c", new String[]{"a, "});
}
public void testNoArgsException() {
Map<String, PsiElement> marks = loadTest(1);
feignCtrlP(marks.get("<arg1>").getTextOffset()).check("<no parameters>", new String[0], new String[]{"<no parameters>"});
}
/**
* Imitates pressing of Ctrl+P; fails if results are not as expected.
* @param offset offset of 'cursor' where ^P is pressed.