Skip to content

Commit f93b1dd

Browse files
committed
Add test for SQL comments and bump version
1 parent a72d5a9 commit f93b1dd

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'com.andrewbrookins.idea.wrap'
8-
version '1.5.0-SNAPSHOT'
8+
version '1.6.0-SNAPSHOT'
99

1010
sourceCompatibility = 1.8
1111

@@ -25,7 +25,12 @@ intellij {
2525
patchPluginXml {
2626
sinceBuild = "141"
2727
changeNotes = """
28-
<b>1.5.0</b>
28+
<b>1.6.0</b>
29+
<ul>
30+
<li>Support SQL comments. Thanks, Elijah Carrel!</li>
31+
</ul>
32+
33+
<b>1.5.0</b>
2934
<ul>
3035
<li>Fix plugin XML compatibility with newer Intellij versions.</li>
3136
<li>Special thanks to <b>Edgars Irmejs</b> and <b>Aleksei Kniazev</b> for fixes!</li>

src/main/java/com/andrewbrookins/idea/wrap/CodeWrapper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.util.regex.Pattern
1010
* This code was inspired by Nir Soffer's codewrap library: * https://pypi.python.org/pypi/codewrap/
1111
*/
1212
class CodeWrapper(
13-
private val commentRegex: Regex = "(/\\*+|\\*/|\\*|\\.|#+|//+|;+)?".toRegex(),
13+
private val commentRegex: Regex = "(/\\*+|\\*/|\\*|\\.|#+|//+|;+|--)?".toRegex(),
1414

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

src/main/resources/META-INF/plugin.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>com.andrewbrookins.wrap_to_column</id>
33
<name>Wrap to Column</name>
4-
<version>1.5.0</version>
4+
<version>1.6.0</version>
55
<vendor email="a@andrewbrookins.com" url="http://andrewbrookins.com">Andrew Brookins</vendor>
66

77
<description><![CDATA[
@@ -35,6 +35,11 @@
3535
]]></description>
3636

3737
<change-notes><![CDATA[
38+
<b>1.6.0</b>
39+
<ul>
40+
<li>Support SQL comments. Thanks, Elijah Carrel!</li>
41+
</ul>
42+
3843
<b>1.5.0</b>
3944
<ul>
4045
<li>Fix plugin XML compatibility with newer Intellij versions.</li>

src/test/java/com/andrewbrookins/idea/wrap/CodeWrapperTest.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,15 @@ class CodeWrapperTests {
196196

197197
assertEquals(expected, text)
198198
}
199+
200+
@Test
201+
fun testWrapsSqlComments() {
202+
val text = wrapper.wrap("-- This is a SQL comment. It may not be an important comment, but it's mine. My own. My precious.")
203+
204+
val expected = "-- This is a SQL comment. It may not be an important comment, but it's\n" +
205+
"-- mine. My own. My precious."
206+
207+
assertEquals(expected, text)
208+
}
199209
}
200210

0 commit comments

Comments
 (0)