Format spaces around !is and !in (KT-13314)
#KT-13314 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
b53cb91e88
commit
926deebff5
@@ -196,6 +196,7 @@ These artifacts include extensions for the types available in the latter JDKs, s
|
||||
#### Formatter
|
||||
|
||||
- [`KT-12830`](https://youtrack.jetbrains.com/issue/KT-12830) Remove spaces before *?* in nullable types
|
||||
- [`KT-13314`](https://youtrack.jetbrains.com/issue/KT-13314) Format spaces around !is and !in
|
||||
|
||||
#### Intention actions, inspections and quickfixes
|
||||
|
||||
|
||||
@@ -167,7 +167,9 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
||||
|
||||
around(AS_KEYWORD).spaces(1)
|
||||
around(IS_KEYWORD).spaces(1)
|
||||
around(NOT_IS).spaces(1)
|
||||
around(IN_KEYWORD).spaces(1)
|
||||
around(NOT_IN).spaces(1)
|
||||
aroundInside(IDENTIFIER, BINARY_EXPRESSION).spaces(1)
|
||||
|
||||
// before LPAR in constructor(): this() {}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun f() {
|
||||
if (1 !in intArrayOf()) {
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun f() {
|
||||
if (1 !in intArrayOf()) {
|
||||
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun f() {
|
||||
if (1 !is Int) {
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun f() {
|
||||
if (1 !is Int) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -433,6 +433,18 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NotIn.after.kt")
|
||||
public void testNotIn() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/NotIn.after.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NotIs.after.kt")
|
||||
public void testNotIs() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/NotIs.after.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NullableType.after.kt")
|
||||
public void testNullableType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/NullableType.after.kt");
|
||||
|
||||
Reference in New Issue
Block a user