Combine multiple docstring formatting helper scripts into one
[idea/community.git] / python / src / com / jetbrains / python / documentation / docstrings / DocStringFormat.java
index caa5ec15a0a1ac757a1b89a7fbeaab7bc1bf90c1..43f32c57f3ab51d58269a8a84c49457ce2731a8e 100644 (file)
@@ -16,7 +16,6 @@
 package com.jetbrains.python.documentation.docstrings;
 
 import com.intellij.psi.PsiElement;
-import com.intellij.util.Function;
 import com.intellij.util.ObjectUtils;
 import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
@@ -32,11 +31,11 @@ public enum DocStringFormat {
   /**
    * @see DocStringUtil#ensureNotPlainDocstringFormat(PsiElement)
    */
-  PLAIN("Plain"),
-  EPYTEXT("Epytext"),
-  REST("reStructuredText"),
-  NUMPY("NumPy"),
-  GOOGLE("Google");
+  PLAIN("Plain", ""),
+  EPYTEXT("Epytext", "epytext"),
+  REST("reStructuredText", "rest"),
+  NUMPY("NumPy", "numpy"),
+  GOOGLE("Google", "google");
 
   public static final List<String> ALL_NAMES = getAllNames();
 
@@ -67,10 +66,12 @@ public enum DocStringFormat {
     return ObjectUtils.notNull(fromName(name), PLAIN);
   }
 
-  String myName;
+  private final String myName;
+  private final String myFormatterCommand;
 
-  DocStringFormat(@NotNull String name) {
+  DocStringFormat(@NotNull String name, @NotNull String formatterCommand) {
     myName = name;
+    myFormatterCommand = formatterCommand;
   }
 
   @NotNull
@@ -78,4 +79,8 @@ public enum DocStringFormat {
     return myName;
   }
 
+  @NotNull
+  public String getFormatterCommand() {
+    return myFormatterCommand;
+  }
 }