Formatter: handle spaces between class name and type parameters (#875)
Fixes #KT-12446
This commit is contained in:
committed by
Dmitry Jemerov
parent
33b6780ce2
commit
c24960f8d9
@@ -182,6 +182,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
|||||||
}
|
}
|
||||||
|
|
||||||
afterInside(CONSTRUCTOR_KEYWORD, PRIMARY_CONSTRUCTOR).spaces(0)
|
afterInside(CONSTRUCTOR_KEYWORD, PRIMARY_CONSTRUCTOR).spaces(0)
|
||||||
|
betweenInside(IDENTIFIER, TYPE_PARAMETER_LIST, CLASS).spaces(0)
|
||||||
|
|
||||||
aroundInside(DOT, DOT_QUALIFIED_EXPRESSION).spaces(0)
|
aroundInside(DOT, DOT_QUALIFIED_EXPRESSION).spaces(0)
|
||||||
aroundInside(SAFE_ACCESS, SAFE_ACCESS_EXPRESSION).spaces(0)
|
aroundInside(SAFE_ACCESS, SAFE_ACCESS_EXPRESSION).spaces(0)
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
class TypeParameter<T> {}
|
||||||
|
class TypeParameter<T>()
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
class TypeParameter < T > {}
|
||||||
|
class TypeParameter < T > ()
|
||||||
@@ -121,6 +121,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
|||||||
doTest(fileName);
|
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")
|
@TestMetadata("ColonSpaces.after.kt")
|
||||||
public void testColonSpaces() throws Exception {
|
public void testColonSpaces() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/ColonSpaces.after.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/ColonSpaces.after.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user