Formatter: remove unnecessary spaces in value and type parameter lists
This commit is contained in:
@@ -80,6 +80,15 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder {
|
|||||||
|
|
||||||
.beforeInside(BLOCK, FUN).spaceIf(jetCommonSettings.SPACE_BEFORE_METHOD_LBRACE)
|
.beforeInside(BLOCK, FUN).spaceIf(jetCommonSettings.SPACE_BEFORE_METHOD_LBRACE)
|
||||||
|
|
||||||
|
.afterInside(LPAR, VALUE_PARAMETER_LIST).spaces(0)
|
||||||
|
.beforeInside(RPAR, VALUE_PARAMETER_LIST).spaces(0)
|
||||||
|
.afterInside(LT, TYPE_PARAMETER_LIST).spaces(0)
|
||||||
|
.beforeInside(GT, TYPE_PARAMETER_LIST).spaces(0)
|
||||||
|
.afterInside(LPAR, VALUE_ARGUMENT_LIST).spaces(0)
|
||||||
|
.beforeInside(RPAR, VALUE_ARGUMENT_LIST).spaces(0)
|
||||||
|
.afterInside(LT, TYPE_ARGUMENT_LIST).spaces(0)
|
||||||
|
.beforeInside(GT, TYPE_ARGUMENT_LIST).spaces(0)
|
||||||
|
|
||||||
// TODO: Ask for better API
|
// TODO: Ask for better API
|
||||||
// Type of the declaration colon
|
// Type of the declaration colon
|
||||||
.beforeInside(COLON, PROPERTY).spaceIf(jetSettings.SPACE_BEFORE_TYPE_COLON)
|
.beforeInside(COLON, PROPERTY).spaceIf(jetSettings.SPACE_BEFORE_TYPE_COLON)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun < T > test( a: Int ) = {( a: Int ) -> a }
|
||||||
|
class Test< T >
|
||||||
|
|
||||||
|
fun foo( ) {
|
||||||
|
test< Int >( 12 )
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun <T> test(a: Int) = {(a: Int) -> a }
|
||||||
|
class Test<T>
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
test<Int>(12)
|
||||||
|
}
|
||||||
@@ -116,6 +116,10 @@ public class JetFormatterTest extends AbstractJetFormatterTest {
|
|||||||
doTestWithInvert();
|
doTestWithInvert();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testUnnecessarySpacesInParametersLists() throws Exception {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testWhen() throws Exception {
|
public void testWhen() throws Exception {
|
||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user