From cb0cf8e563c2ede9144b2260b30078566f8b8865 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 21 Aug 2012 13:25:17 +0400 Subject: [PATCH] KT-1545 reformatting of kotlin code uses incorrect indentation for multi-line kdoc comments #KT-1545 Open --- idea/testData/formatter/EmptyLineAfterPackage.kt | 10 +--------- .../testData/formatter/EmptyLineAfterPackage_after.kt | 10 +--------- idea/testData/formatter/SaveSpacesInDocComments.kt | 11 +++++++++++ .../formatter/SaveSpacesInDocComments_after.kt | 11 +++++++++++ .../org/jetbrains/jet/formatter/JetFormatterTest.java | 4 ++++ 5 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 idea/testData/formatter/SaveSpacesInDocComments.kt create mode 100644 idea/testData/formatter/SaveSpacesInDocComments_after.kt diff --git a/idea/testData/formatter/EmptyLineAfterPackage.kt b/idea/testData/formatter/EmptyLineAfterPackage.kt index c1002b3df28..05e7553221b 100644 --- a/idea/testData/formatter/EmptyLineAfterPackage.kt +++ b/idea/testData/formatter/EmptyLineAfterPackage.kt @@ -1,9 +1 @@ -package p1.p2;/** - * Created with IntelliJ IDEA. - * User: someone - * Date: 2/16/12 - * Time: 4:23 PM - * To change this template use File | Settings | File Templates. - */ - -// TODO: Fix formatting of doc comments \ No newline at end of file +package p1.p2;/** some */ \ No newline at end of file diff --git a/idea/testData/formatter/EmptyLineAfterPackage_after.kt b/idea/testData/formatter/EmptyLineAfterPackage_after.kt index c2b1cf05d2d..6ccbb3c7e33 100644 --- a/idea/testData/formatter/EmptyLineAfterPackage_after.kt +++ b/idea/testData/formatter/EmptyLineAfterPackage_after.kt @@ -1,11 +1,3 @@ package p1.p2; -/** -* Created with IntelliJ IDEA. -* User: someone -* Date: 2/16/12 -* Time: 4:23 PM -* To change this template use File | Settings | File Templates. -*/ - -// TODO: Fix formatting of doc comments \ No newline at end of file +/** some */ \ No newline at end of file diff --git a/idea/testData/formatter/SaveSpacesInDocComments.kt b/idea/testData/formatter/SaveSpacesInDocComments.kt new file mode 100644 index 00000000000..0a229a17384 --- /dev/null +++ b/idea/testData/formatter/SaveSpacesInDocComments.kt @@ -0,0 +1,11 @@ +/** + * Hello + */ +class Some { + /** + * Returns the collection of functions with duplicate function names filtered out + * so only the first one is included + */ + fun test() { + } +} diff --git a/idea/testData/formatter/SaveSpacesInDocComments_after.kt b/idea/testData/formatter/SaveSpacesInDocComments_after.kt new file mode 100644 index 00000000000..0a229a17384 --- /dev/null +++ b/idea/testData/formatter/SaveSpacesInDocComments_after.kt @@ -0,0 +1,11 @@ +/** + * Hello + */ +class Some { + /** + * Returns the collection of functions with duplicate function names filtered out + * so only the first one is included + */ + fun test() { + } +} diff --git a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTest.java b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTest.java index 0eb7ce5170f..987e9654ee3 100644 --- a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTest.java +++ b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTest.java @@ -88,6 +88,10 @@ public class JetFormatterTest extends AbstractJetFormatterTest { doTestWithInvert(); } + public void testSaveSpacesInDocComments() throws Exception { + doTest(); + } + public void testSingleLineFunctionLiteral() throws Exception { doTest(); }