mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix Tab not working to move to next completion parameter, when current parameter is a field reference
This commit is contained in:
+2
-1
@@ -43,7 +43,8 @@ public class JavaNextParameterHandler extends EditorActionHandler {
|
||||
int next = CharArrayUtil.shiftForward(text, offset, " \t");
|
||||
PsiExpressionList list = (PsiExpressionList)exprList;
|
||||
int actualParameterCount = list.getExpressionCount();
|
||||
int lastParamStart = actualParameterCount == 0 ? list.getTextOffset() + 1 : list.getExpressions()[actualParameterCount - 1].getTextOffset();
|
||||
int lastParamStart = actualParameterCount == 0 ? list.getTextOffset() + 1
|
||||
: list.getExpressions()[actualParameterCount - 1].getTextRange().getStartOffset();
|
||||
if (next >= lastParamStart) {
|
||||
int prev = CharArrayUtil.shiftBackward(text, lastParamStart - 1, " \t");
|
||||
char prevChar = prev >= 0 && prev < editor.getDocument().getTextLength() ? text
|
||||
|
||||
+30
@@ -1401,6 +1401,36 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase {
|
||||
checkResultWithInlays("class C { void m() { System.getProperty(new String(<Hint text=\"bytes:\"/>null, <HINT text=\"charsetName:\"/><caret>)) } }");
|
||||
}
|
||||
|
||||
public void testFieldAccessInsideMethodInvocation() throws Exception {
|
||||
enableVirtualComma();
|
||||
|
||||
configureJava("class C {\n" +
|
||||
" int x;\n" +
|
||||
" void some(int a, int b) {}\n" +
|
||||
" void other() { som<caret> }\n" +
|
||||
"}");
|
||||
complete();
|
||||
checkResultWithInlays("class C {\n" +
|
||||
" int x;\n" +
|
||||
" void some(int a, int b) {}\n" +
|
||||
" void other() { some(<HINT text=\"a:\"/><caret><Hint text=\",b:\"/>); }\n" +
|
||||
"}");
|
||||
type("this.");
|
||||
complete("x");
|
||||
checkResultWithInlays("class C {\n" +
|
||||
" int x;\n" +
|
||||
" void some(int a, int b) {}\n" +
|
||||
" void other() { some(<HINT text=\"a:\"/>this.x<caret><Hint text=\",b:\"/>); }\n" +
|
||||
"}");
|
||||
next();
|
||||
waitForAllAsyncStuff();
|
||||
checkResultWithInlays("class C {\n" +
|
||||
" int x;\n" +
|
||||
" void some(int a, int b) {}\n" +
|
||||
" void other() { some(<Hint text=\"a:\"/>this.x, <HINT text=\"b:\"/><caret>); }\n" +
|
||||
"}");
|
||||
}
|
||||
|
||||
private void checkResultWithInlays(String text) {
|
||||
myFixture.checkResultWithInlays(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user