Format spaces in cast expression (KT-12035)

#KT-12035 Fixed
This commit is contained in:
Kirill
2016-04-23 17:07:40 +02:00
committed by Nikolay Krasko
parent a00c524074
commit 01b754b318
5 changed files with 15 additions and 0 deletions
+1
View File
@@ -42,6 +42,7 @@ Issues fixed:
- [KT-11512](https://youtrack.jetbrains.com/issue/KT-11512) Allow choosing any source root in "Move file to directory" intention
- [KT-10950](https://youtrack.jetbrains.com/issue/KT-10950) Keep original file package name when moving top-level declarations to separate file (provided it's not ambiguous)
- [KT-10174](https://youtrack.jetbrains.com/issue/KT-10174) Optimize imports after applying "Move declaration to separate file" intention
- [KT-12035](https://youtrack.jetbrains.com/issue/KT-12035) Auto-format cast expressions
#### Debugger
@@ -164,6 +164,8 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
betweenInside(DOT, IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
afterInside(IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
around(AS_KEYWORD).spaces(1)
// before LPAR in constructor(): this() {}
after(CONSTRUCTOR_DELEGATION_REFERENCE).spacing(0, 0, 0, false, 0)
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
val a = 1 as Int
}
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
val a = 1 as Int
}
@@ -91,6 +91,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
doTest(fileName);
}
@TestMetadata("Cast.after.kt")
public void testCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/Cast.after.kt");
doTest(fileName);
}
@TestMetadata("CatchFinallyOnNewLine.after.kt")
public void testCatchFinallyOnNewLine() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/CatchFinallyOnNewLine.after.kt");