Skip to content

Commit 3f6a1d9

Browse files
Merge pull request #5 from protostuff/feature/commenter
Add commenter
2 parents 079ab1a + 994dc62 commit 3f6a1d9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package io.protostuff.jetbrains.plugin;
2+
3+
import com.intellij.lang.Commenter;
4+
5+
/**
6+
* @author Kostiantyn Shchepanovskyi
7+
*/
8+
public class ProtoCommenter implements Commenter {
9+
10+
public static final String LINE_COMMENT_PREFIX = "//";
11+
public static final String BLOCK_COMMENT_PREFIX = "/*";
12+
public static final String BLOCK_COMMENT_SUFFIX = "*/";
13+
14+
public String getLineCommentPrefix() {
15+
return LINE_COMMENT_PREFIX;
16+
}
17+
18+
public String getBlockCommentPrefix() {
19+
return BLOCK_COMMENT_PREFIX;
20+
}
21+
22+
public String getBlockCommentSuffix() {
23+
return BLOCK_COMMENT_SUFFIX;
24+
}
25+
26+
public String getCommentedBlockCommentPrefix() {
27+
return null;
28+
}
29+
30+
public String getCommentedBlockCommentSuffix() {
31+
return null;
32+
}
33+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
<colorSettingsPage implementation="io.protostuff.jetbrains.plugin.ProtoColorSettingsPage"/>
7979

80+
<lang.commenter language="PROTO" implementationClass="io.protostuff.jetbrains.plugin.ProtoCommenter"/>
8081
</extensions>
8182

8283
<actions>

0 commit comments

Comments
 (0)