mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Formatter: Add blank line before class/object declaration inside of declaration body
GitOrigin-RevId: aa5774be029e9910750fb0f14155b1fae3f49238
This commit is contained in:
committed by
intellij-monorepo-bot
parent
54bc0e2ee6
commit
1801570cff
@@ -100,9 +100,10 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder {
|
||||
between(ENUM_ENTRY, DECLARATIONS).blankLines(1)
|
||||
|
||||
beforeInside(FUN, TokenSet.create(BODY, CLASS_BODY)).lineBreakInCode()
|
||||
beforeInside(CLASS, TokenSet.create(BODY, CLASS_BODY)).lineBreakInCode()
|
||||
beforeInside(OBJECT_DECLARATION, TokenSet.create(BODY, CLASS_BODY)).lineBreakInCode()
|
||||
before(PROPERTY).lineBreakInCode()
|
||||
|
||||
|
||||
after(DOC_COMMENT).lineBreakInCode()
|
||||
|
||||
// =============== Spacing ================
|
||||
|
||||
+12
@@ -97,6 +97,12 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassInBody.after.kt")
|
||||
public void testClassInBody() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/ClassInBody.after.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassLineBreak.after.kt")
|
||||
public void testClassLineBreak() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/ClassLineBreak.after.kt");
|
||||
@@ -355,6 +361,12 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ObjectInBody.after.kt")
|
||||
public void testObjectInBody() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/ObjectInBody.after.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ParameterDocComments.after.kt")
|
||||
public void testParameterDocComments() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/ParameterDocComments.after.kt");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
class A { // abc
|
||||
class B
|
||||
}
|
||||
|
||||
class A {
|
||||
class B {}
|
||||
}
|
||||
|
||||
class A {
|
||||
class B {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
// abc
|
||||
class B
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
class B {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
class B {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
class A { // abc
|
||||
class B
|
||||
}
|
||||
|
||||
class A { class B {}
|
||||
}
|
||||
|
||||
class A { class B {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() { // abc
|
||||
class B
|
||||
}
|
||||
|
||||
fun foo() { class B {}
|
||||
}
|
||||
|
||||
fun foo() { class B {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
class A { // abc
|
||||
object B
|
||||
}
|
||||
|
||||
class A {
|
||||
object B {}
|
||||
}
|
||||
|
||||
class A {
|
||||
object B {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
// abc
|
||||
object B
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
object B {}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
object B {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
class A { // abc
|
||||
object B
|
||||
}
|
||||
|
||||
class A { object B {}
|
||||
}
|
||||
|
||||
class A { object B {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() { // abc
|
||||
object B
|
||||
}
|
||||
|
||||
fun foo() { object B {}
|
||||
}
|
||||
|
||||
fun foo() { object B {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user