Formatter: handle spaces between class name and type parameters (#875)

Fixes #KT-12446
This commit is contained in:
Kirill Rakhman
2016-06-01 20:20:56 +02:00
committed by Dmitry Jemerov
parent 33b6780ce2
commit c24960f8d9
4 changed files with 11 additions and 0 deletions
@@ -182,6 +182,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
}
afterInside(CONSTRUCTOR_KEYWORD, PRIMARY_CONSTRUCTOR).spaces(0)
betweenInside(IDENTIFIER, TYPE_PARAMETER_LIST, CLASS).spaces(0)
aroundInside(DOT, DOT_QUALIFIED_EXPRESSION).spaces(0)
aroundInside(SAFE_ACCESS, SAFE_ACCESS_EXPRESSION).spaces(0)
+2
View File
@@ -0,0 +1,2 @@
class TypeParameter<T> {}
class TypeParameter<T>()
+2
View File
@@ -0,0 +1,2 @@
class TypeParameter < T > {}
class TypeParameter < T > ()
@@ -121,6 +121,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
doTest(fileName);
}
@TestMetadata("ClassTypeParam.after.kt")
public void testClassTypeParam() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/ClassTypeParam.after.kt");
doTest(fileName);
}
@TestMetadata("ColonSpaces.after.kt")
public void testColonSpaces() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/ColonSpaces.after.kt");