mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
IDEA-112014 Complete Current Statement - doesn't work correctly on a multi-line statement
This commit is contained in:
@@ -61,7 +61,9 @@ public class MethodCallFixer implements Fixer {
|
||||
}
|
||||
|
||||
final PsiExpression[] params = args.getExpressions();
|
||||
if (params.length > 0 && startLine(editor, args) != startLine(editor, params[0])) {
|
||||
if (params.length > 0 &&
|
||||
startLine(editor, args) != startLine(editor, params[0]) &&
|
||||
editor.getCaretModel().getOffset() < params[0].getTextRange().getStartOffset()) {
|
||||
endOffset = args.getTextRange().getStartOffset() + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
Object method() {
|
||||
method(
|
||||
factory()<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
Object method() {
|
||||
method(
|
||||
factory());<caret>
|
||||
}
|
||||
}
|
||||
@@ -205,6 +205,7 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
public void testIDEADEV40479() throws Exception { doTest(); }
|
||||
|
||||
public void testMultilineReturn() throws Exception { doTest(); }
|
||||
public void testMultilineCall() throws Exception { doTest(); }
|
||||
|
||||
public void testIDEADEV13019() throws Exception {
|
||||
doTestBracesNextLineStyle();
|
||||
|
||||
Reference in New Issue
Block a user