-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Don't remove newline when moving comments into class KDoc (#1119)
### What's done: * Refactoring in `KdocComments` * Fix in logic: don't remove `WHITE_SPACE` nodes when moving comment node * Added tests * Fixed bug with incorrect `isFixMode` flag in `KdocComments` This pull request closes #1115
- Loading branch information
Showing
5 changed files
with
100 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
diktat-rules/src/test/resources/test/paragraph2/kdoc/ConstructorCommentNewlineExpected.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test.paragraph2.kdoc | ||
|
||
/** | ||
* @property param1 | ||
* @property param2 first comment | ||
*/ | ||
class Example( | ||
val param1: String, | ||
val param2: String, // second comment | ||
) | ||
|
||
/** | ||
* @property param1 | ||
* @property param2 first comment | ||
*/ | ||
class Example( | ||
val param1: String, | ||
val param2: String, /* second comment */ | ||
) |
11 changes: 11 additions & 0 deletions
11
diktat-rules/src/test/resources/test/paragraph2/kdoc/ConstructorCommentNewlineTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package test.paragraph2.kdoc | ||
|
||
class Example( | ||
val param1: String, // first comment | ||
val param2: String, // second comment | ||
) | ||
|
||
class Example( | ||
val param1: String, /* first comment */ | ||
val param2: String, /* second comment */ | ||
) |