Codemirror: Add support for Groovy mode
Change-Id: I7654e4c9911a3c6da9023155440445a4e777516b
diff --git a/gerrit-gwtui/src/main/java/net/codemirror/lib/ModeInjector.java b/gerrit-gwtui/src/main/java/net/codemirror/lib/ModeInjector.java
index 3b491e7..cc13fcd 100644
--- a/gerrit-gwtui/src/main/java/net/codemirror/lib/ModeInjector.java
+++ b/gerrit-gwtui/src/main/java/net/codemirror/lib/ModeInjector.java
@@ -45,6 +45,7 @@
Modes.I.commonlisp(),
Modes.I.css(),
Modes.I.go(),
+ Modes.I.groovy(),
Modes.I.htmlmixed(),
Modes.I.javascript(),
Modes.I.perl(),
diff --git a/gerrit-gwtui/src/main/java/net/codemirror/mode/Modes.java b/gerrit-gwtui/src/main/java/net/codemirror/mode/Modes.java
index 4f93331..307403a 100644
--- a/gerrit-gwtui/src/main/java/net/codemirror/mode/Modes.java
+++ b/gerrit-gwtui/src/main/java/net/codemirror/mode/Modes.java
@@ -29,6 +29,7 @@
@Source("commonlisp/commonlisp.js") @DoNotEmbed DataResource commonlisp();
@Source("css/css.js") @DoNotEmbed DataResource css();
@Source("go/go.js") @DoNotEmbed DataResource go();
+ @Source("groovy/groovy.js") @DoNotEmbed DataResource groovy();
@Source("htmlmixed/htmlmixed.js") @DoNotEmbed DataResource htmlmixed();
@Source("javascript/javascript.js") @DoNotEmbed DataResource javascript();
@Source("perl/perl.js") @DoNotEmbed DataResource perl();
diff --git a/gerrit-gwtui/src/main/java/net/codemirror/mode/mode_map b/gerrit-gwtui/src/main/java/net/codemirror/mode/mode_map
index 141fffc..2d076cd 100644
--- a/gerrit-gwtui/src/main/java/net/codemirror/mode/mode_map
+++ b/gerrit-gwtui/src/main/java/net/codemirror/mode/mode_map
@@ -21,6 +21,9 @@
go:
text/x-go
+groovy:
+text/x-groovy
+
htmlmixed:
text/html
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java b/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java
index c8c27af..bda15d0 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java
@@ -51,6 +51,7 @@
.put("lisp", LISP)
.put("lsp", LISP)
.put("clj", newMimeType("text/x-clojure", 2))
+ .put("groovy", newMimeType("text/x-groovy", 2))
.build();
private static MimeType newMimeType(String type, final int specificity) {
diff --git a/lib/codemirror/cm3.defs b/lib/codemirror/cm3.defs
index 83db230..8de280a 100644
--- a/lib/codemirror/cm3.defs
+++ b/lib/codemirror/cm3.defs
@@ -19,6 +19,7 @@
'commonlisp/commonlisp.js',
'css/css.js',
'go/go.js',
+ 'groovy/groovy.js',
'htmlmixed/htmlmixed.js',
'javascript/javascript.js',
'perl/perl.js',