Honor "Use continuation indent in argument lists" for indent by Enter
#KT-22121 Fixed
This commit is contained in:
@@ -262,10 +262,13 @@ abstract class KotlinCommonBlock(
|
|||||||
ChildAttributes(block.indent, block.alignment)
|
ChildAttributes(block.indent, block.alignment)
|
||||||
} else {
|
} else {
|
||||||
val indent =
|
val indent =
|
||||||
if (type == KtNodeTypes.VALUE_PARAMETER_LIST && !settings.kotlinCustomSettings.CONTINUATION_INDENT_IN_PARAMETER_LISTS)
|
if ((type == KtNodeTypes.VALUE_PARAMETER_LIST && !settings.kotlinCustomSettings.CONTINUATION_INDENT_IN_PARAMETER_LISTS) ||
|
||||||
|
(type == KtNodeTypes.VALUE_ARGUMENT_LIST && !settings.kotlinCustomSettings.CONTINUATION_INDENT_IN_ARGUMENT_LISTS)
|
||||||
|
) {
|
||||||
Indent.getNormalIndent()
|
Indent.getNormalIndent()
|
||||||
else
|
} else {
|
||||||
Indent.getContinuationIndent()
|
Indent.getContinuationIndent()
|
||||||
|
}
|
||||||
ChildAttributes(indent, null)
|
ChildAttributes(indent, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fun test(i: Int) {
|
||||||
|
test(
|
||||||
|
<caret>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
fun test(i: Int) {
|
||||||
|
test(<caret>)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SET_FALSE: CONTINUATION_INDENT_IN_ARGUMENT_LISTS
|
||||||
+8
-13
@@ -1,17 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2017 JetBrains s.r.o.
|
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
*
|
* that can be found in the license/LICENSE.txt file.
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.formatter;
|
package org.jetbrains.kotlin.formatter;
|
||||||
@@ -74,6 +63,12 @@ public class TypingIndentationTestBaseGenerated extends AbstractTypingIndentatio
|
|||||||
doNewlineTest(fileName);
|
doNewlineTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ArgumentListNormalIndent.after.kt")
|
||||||
|
public void testArgumentListNormalIndent() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/indentationOnNewline/ArgumentListNormalIndent.after.kt");
|
||||||
|
doNewlineTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("AssignmentAfterEq.after.kt")
|
@TestMetadata("AssignmentAfterEq.after.kt")
|
||||||
public void testAssignmentAfterEq() throws Exception {
|
public void testAssignmentAfterEq() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/indentationOnNewline/AssignmentAfterEq.after.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user