From 994dc62cf90041da85c37a03d80389afd586371d Mon Sep 17 00:00:00 2001 From: Konstantin Shchepanovskyi Date: Sun, 10 Apr 2016 11:30:12 +0300 Subject: [PATCH] Add commenter: comment a line or block of code using `Ctrl+/` or `Ctrl+Shift+/` --- .../jetbrains/plugin/ProtoCommenter.java | 33 +++++++++++++++++++ src/main/resources/META-INF/plugin.xml | 1 + 2 files changed, 34 insertions(+) create mode 100644 src/main/java/io/protostuff/jetbrains/plugin/ProtoCommenter.java diff --git a/src/main/java/io/protostuff/jetbrains/plugin/ProtoCommenter.java b/src/main/java/io/protostuff/jetbrains/plugin/ProtoCommenter.java new file mode 100644 index 0000000..938504c --- /dev/null +++ b/src/main/java/io/protostuff/jetbrains/plugin/ProtoCommenter.java @@ -0,0 +1,33 @@ +package io.protostuff.jetbrains.plugin; + +import com.intellij.lang.Commenter; + +/** + * @author Kostiantyn Shchepanovskyi + */ +public class ProtoCommenter implements Commenter { + + public static final String LINE_COMMENT_PREFIX = "//"; + public static final String BLOCK_COMMENT_PREFIX = "/*"; + public static final String BLOCK_COMMENT_SUFFIX = "*/"; + + public String getLineCommentPrefix() { + return LINE_COMMENT_PREFIX; + } + + public String getBlockCommentPrefix() { + return BLOCK_COMMENT_PREFIX; + } + + public String getBlockCommentSuffix() { + return BLOCK_COMMENT_SUFFIX; + } + + public String getCommentedBlockCommentPrefix() { + return null; + } + + public String getCommentedBlockCommentSuffix() { + return null; + } +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 13c59f1..396b2c9 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -77,6 +77,7 @@ +