mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-65987 Java Formatter: Correct anonymous classes instances as method arguments processing
1. 'Enforce parent indent' option is added to indent construction API; 2. Corresponding support is added to formatter's core; 3. Corresponding support is added to java blocks construction algorithm; 4. Corresponding test is added;
This commit is contained in:
+25
@@ -307,4 +307,29 @@ public class JavaFormatterIndentationTest extends AbstractJavaFormatterTest {
|
||||
doClassTest(precededBySingleLineComment, precededBySingleLineComment);
|
||||
doClassTest(precededByMultiLineComment, precededByMultiLineComment);
|
||||
}
|
||||
|
||||
public void testAnonymousClassInstancesAsMethodCallArguments() throws Exception {
|
||||
// Inspired by IDEA-65987
|
||||
|
||||
doMethodTest(
|
||||
"foo(\"long string as the first argument\", new Runnable() {\n" +
|
||||
"public void run() { \n" +
|
||||
"} \n" +
|
||||
"}, \n" +
|
||||
"new Runnable() { \n" +
|
||||
"public void run() { \n" +
|
||||
"} \n" +
|
||||
"} \n" +
|
||||
"); ",
|
||||
"foo(\"long string as the first argument\", new Runnable() {\n" +
|
||||
" public void run() { \n" +
|
||||
" } \n" +
|
||||
" }, \n" +
|
||||
" new Runnable() { \n" +
|
||||
" public void run() { \n" +
|
||||
" } \n" +
|
||||
" } \n" +
|
||||
"); "
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user