Formatter: format around safe cast operator as? (KT-32324)
#KT-32324 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
44e9090931
commit
9f6e88d571
@@ -301,6 +301,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
||||
aroundInside(DOT, USER_TYPE).spaces(0)
|
||||
|
||||
around(AS_KEYWORD).spaces(1)
|
||||
around(AS_SAFE).spaces(1)
|
||||
around(IS_KEYWORD).spaces(1)
|
||||
around(NOT_IS).spaces(1)
|
||||
around(IN_KEYWORD).spaces(1)
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(a: Any) {
|
||||
a as? String
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
fun main(a: Any) {
|
||||
a as?String
|
||||
}
|
||||
@@ -616,6 +616,11 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
||||
runTest("idea/testData/formatter/RightBracketOnNewLine.after.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SafeCast.after.kt")
|
||||
public void testSafeCast() throws Exception {
|
||||
runTest("idea/testData/formatter/SafeCast.after.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SaveSpacesInDocComments.after.kt")
|
||||
public void testSaveSpacesInDocComments() throws Exception {
|
||||
runTest("idea/testData/formatter/SaveSpacesInDocComments.after.kt");
|
||||
|
||||
Reference in New Issue
Block a user