- Fix typing enter after import
- Prepared tests for KT-1161 (disabled)
This commit is contained in:
@@ -112,7 +112,21 @@ public class JetBlock extends AbstractBlock {
|
|||||||
childIndent = Indent.getNormalIndent();
|
childIndent = Indent.getNormalIndent();
|
||||||
}
|
}
|
||||||
else if (childParent != null && childParent.getElementType() == JetNodeTypes.DOT_QUALIFIED_EXPRESSION) {
|
else if (childParent != null && childParent.getElementType() == JetNodeTypes.DOT_QUALIFIED_EXPRESSION) {
|
||||||
if (childParent.getFirstChildNode() != this) {
|
if (childParent.getFirstChildNode() != child && childParent.getLastChildNode() != child) {
|
||||||
|
childIndent = Indent.getContinuationWithoutFirstIndent(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (childParent != null && childParent.getElementType() == JetNodeTypes.VALUE_PARAMETER_LIST) {
|
||||||
|
String childText = child.getText();
|
||||||
|
|
||||||
|
if (!(childText.equals("(") || childText.equals(")"))) {
|
||||||
|
childIndent = Indent.getContinuationWithoutFirstIndent(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (childParent != null && childParent.getElementType() == JetNodeTypes.TYPE_PARAMETER_LIST) {
|
||||||
|
String childText = child.getText();
|
||||||
|
|
||||||
|
if (!(childText.equals("<") || childText.equals(">"))) {
|
||||||
childIndent = Indent.getContinuationWithoutFirstIndent(false);
|
childIndent = Indent.getContinuationWithoutFirstIndent(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,7 +171,7 @@ public class JetBlock extends AbstractBlock {
|
|||||||
return new ChildAttributes(Indent.getContinuationWithoutFirstIndent(), null);
|
return new ChildAttributes(Indent.getContinuationWithoutFirstIndent(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getChildAttributes(newChildIndex);
|
return new ChildAttributes(Indent.getNoneIndent(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import java.util.ArrayList
|
||||||
|
<caret>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import java.util.ArrayList<caret>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun testParam(
|
||||||
|
<caret>) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun testParam(
|
||||||
|
<caret>) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun testParam(a : String, b : Int,
|
||||||
|
<caret>) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fun testParam(a : String, b : Int,<caret>) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun some(
|
||||||
|
a: Int,
|
||||||
|
b: String, c: Int,
|
||||||
|
d: String, e: Int
|
||||||
|
) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun some(
|
||||||
|
a: Int,
|
||||||
|
b: String, c: Int,
|
||||||
|
d: String, e: Int
|
||||||
|
) {
|
||||||
|
}
|
||||||
@@ -24,6 +24,10 @@ public class JetFormatterTest extends AbstractJetFormatterTest {
|
|||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testParameters() throws Exception {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testWhen() throws Exception {
|
public void testWhen() throws Exception {
|
||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class JetTypingIndentationTest extends LightCodeInsightTestCase {
|
public class JetTypingIndentationTest extends LightCodeInsightTestCase {
|
||||||
|
|
||||||
|
public void testAfterImport() {
|
||||||
|
doFileNewlineTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testConsecutiveCallsAfterDot() {
|
public void testConsecutiveCallsAfterDot() {
|
||||||
doFileNewlineTest();
|
doFileNewlineTest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user