Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/andrewbrookins/idea/wrap/CodeWrapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.regex.Pattern
* This code was inspired by Nir Soffer's codewrap library: * https://pypi.python.org/pypi/codewrap/
*/
class CodeWrapper(
private val commentRegex: Regex = "(/\\*+|\\*/|\\*|\\.|#+|//+|;+|--|'''|\"\"\"|>)?".toRegex(),
private val commentRegex: Regex = "(/\\*+|\\*/|\\*|\\.|#+|//+!?|;+|--|'''|\"\"\"|>)?".toRegex(),

private val newlineRegex: Regex = "(\\r?\\n)".toRegex(),

Expand Down
14 changes: 14 additions & 0 deletions src/test/java/com/andrewbrookins/idea/wrap/CodeWrapperTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,20 @@ class CodeWrapperTests {
> incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
> nostrud exercitation
"""
),
WrapTestCase(
description = "Wraps Rust parent line comments",
rawInput = """
//! My foo module
//!
//! This is the documentation for my foo module. It has some pretty long lines, which I consider a feature and not a bug.
""",
rawExpectedOutput = """
//! My foo module
//!
//! This is the documentation for my foo module. It has some pretty long lines,
//! which I consider a feature and not a bug.
"""
)
)

Expand Down