void () { Map<String, PsiElement> marks = loadTest(3); PsiElement arg1 = marks.get("<arg1>"); feignCtrlP(arg1.getTextOffset()).check("a, b, c", new String[]{"a, "}); feignCtrlP(arg1.getTextOffset()+1).check("a, b, c", new String[]{"a, "}); feignCtrlP(arg1.getTextOffset()-3).assertNotFound(); // ^P before arglist gives nothing PsiElement arg2 = marks.get("<arg2>"); feignCtrlP(arg2.getTextOffset()).check("a, b, c", new String[]{"b, "}); feignCtrlP(arg2.getTextOffset()+1).check("a, b, c", new String[]{"b, "}); feignCtrlP(arg2.getTextOffset()+2).check("a, b, c", new String[]{"c"}); // one too far after arg2, and we came to arg3 PsiElement arg3 = marks.get("<arg3>"); feignCtrlP(arg3.getTextOffset()).check("a, b, c", new String[]{"c"}); feignCtrlP(arg3.getTextOffset()+1).check("a, b, c", new String[]{"c"}); feignCtrlP(arg3.getTextOffset()-1).check("a, b, c", new String[]{"c"}); // space before arg goes to that arg feignCtrlP(arg3.getTextOffset()+2).check("a, b, c", ArrayUtil.EMPTY_STRING_ARRAY); // ^P on a ")" gives nothing }