Format spaces in cast expression (KT-12035)
#KT-12035 Fixed
This commit is contained in:
@@ -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-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-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-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
|
#### Debugger
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,8 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
|||||||
betweenInside(DOT, IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
|
betweenInside(DOT, IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
|
||||||
afterInside(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() {}
|
// before LPAR in constructor(): this() {}
|
||||||
after(CONSTRUCTOR_DELEGATION_REFERENCE).spacing(0, 0, 0, false, 0)
|
after(CONSTRUCTOR_DELEGATION_REFERENCE).spacing(0, 0, 0, false, 0)
|
||||||
|
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fun foo() {
|
||||||
|
val a = 1 as Int
|
||||||
|
}
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fun foo() {
|
||||||
|
val a = 1 as Int
|
||||||
|
}
|
||||||
@@ -91,6 +91,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
|||||||
doTest(fileName);
|
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")
|
@TestMetadata("CatchFinallyOnNewLine.after.kt")
|
||||||
public void testCatchFinallyOnNewLine() throws Exception {
|
public void testCatchFinallyOnNewLine() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/CatchFinallyOnNewLine.after.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/CatchFinallyOnNewLine.after.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user