Formatter: Remove spaces between expression and parentheses
#KT-11476 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
56477f0af8
commit
146dca2cd6
@@ -192,6 +192,8 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder {
|
||||
|
||||
after(LBRACKET).spaces(0)
|
||||
before(RBRACKET).spaces(0)
|
||||
after(LPAR).spaces(0)
|
||||
before(RPAR).spaces(0)
|
||||
|
||||
afterInside(LPAR, VALUE_PARAMETER_LIST).spaces(0)
|
||||
beforeInside(RPAR, VALUE_PARAMETER_LIST).spaces(0)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fun some() {
|
||||
(1)
|
||||
(1 + 2)
|
||||
("" as Any)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun some() {
|
||||
( 1 )
|
||||
( 1 + 2 )
|
||||
( "" as Any )
|
||||
}
|
||||
@@ -499,6 +499,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SpacedInsideParans.after.kt")
|
||||
public void testSpacedInsideParans() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/SpacedInsideParans.after.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SpacesAroundOperations.after.kt")
|
||||
public void testSpacesAroundOperations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/SpacesAroundOperations.after.kt");
|
||||
|
||||
@@ -596,12 +596,12 @@ class SmartEnterTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
// Check that no addition {} inserted
|
||||
fun testWhenBadParsed() = doFunTest(
|
||||
"""
|
||||
when ( {<caret>
|
||||
when ({<caret>
|
||||
}
|
||||
"""
|
||||
,
|
||||
"""
|
||||
when ( {
|
||||
when ({
|
||||
<caret>
|
||||
}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user