Add all language modes from CodeMirror 5.13

We forgot to include these in the past CodeMirror upgrades.
Updated to include all language modes available as of 5.13.

Also add many more extensions to mime-types.properties so we get more
syntax highlighting.

Bug: Issue 3947
Change-Id: Ib5d45bce5b02d42d3b58423f97079d8d73318057
This commit is contained in:
Michael Zhou
2016-02-19 15:36:33 -05:00
parent 2561273bd7
commit 993cbcba78
4 changed files with 408 additions and 3 deletions

View File

@@ -37,49 +37,119 @@ public class ModeInfo extends JavaScriptObject {
static {
indexModes(new DataResource[] {
Modes.I.apl(),
Modes.I.asciiarmor(),
Modes.I.asn_1(),
Modes.I.asterisk(),
Modes.I.brainfuck(),
Modes.I.clike(),
Modes.I.clojure(),
Modes.I.cmake(),
Modes.I.cobol(),
Modes.I.coffeescript(),
Modes.I.commonlisp(),
Modes.I.crystal(),
Modes.I.css(),
Modes.I.cypher(),
Modes.I.d(),
Modes.I.dart(),
Modes.I.diff(),
Modes.I.django(),
Modes.I.dockerfile(),
Modes.I.dtd(),
Modes.I.dylan(),
Modes.I.ebnf(),
Modes.I.ecl(),
Modes.I.eiffel(),
Modes.I.elm(),
Modes.I.erlang(),
Modes.I.factor(),
Modes.I.fcl(),
Modes.I.forth(),
Modes.I.fortran(),
Modes.I.gas(),
Modes.I.gerrit_commit(),
Modes.I.gfm(),
Modes.I.gherkin(),
Modes.I.go(),
Modes.I.groovy(),
Modes.I.haml(),
Modes.I.handlebars(),
Modes.I.haskell_literate(),
Modes.I.haskell(),
Modes.I.haxe(),
Modes.I.htmlembedded(),
Modes.I.htmlmixed(),
Modes.I.http(),
Modes.I.idl(),
Modes.I.jade(),
Modes.I.javascript(),
Modes.I.jinja2(),
Modes.I.jsx(),
Modes.I.julia(),
Modes.I.livescript(),
Modes.I.lua(),
Modes.I.markdown(),
Modes.I.mathematica(),
Modes.I.mirc(),
Modes.I.mllike(),
Modes.I.modelica(),
Modes.I.mscgen(),
Modes.I.mumps(),
Modes.I.nginx(),
Modes.I.nsis(),
Modes.I.ntriples(),
Modes.I.octave(),
Modes.I.oz(),
Modes.I.pascal(),
Modes.I.pegjs(),
Modes.I.perl(),
Modes.I.php(),
Modes.I.pig(),
Modes.I.properties(),
Modes.I.protobuf(),
Modes.I.puppet(),
Modes.I.python(),
Modes.I.q(),
Modes.I.r(),
Modes.I.rpm(),
Modes.I.rst(),
Modes.I.ruby(),
Modes.I.rust(),
Modes.I.scheme(),
Modes.I.shell(),
Modes.I.smalltalk(),
Modes.I.smarty(),
Modes.I.solr(),
Modes.I.soy(),
Modes.I.sparql(),
Modes.I.spreadsheet(),
Modes.I.sql(),
Modes.I.stex(),
Modes.I.stylus(),
Modes.I.swift(),
Modes.I.tcl(),
Modes.I.textile(),
Modes.I.tiddlywiki(),
Modes.I.tiki(),
Modes.I.toml(),
Modes.I.tornado(),
Modes.I.troff(),
Modes.I.ttcn_cfg(),
Modes.I.ttcn(),
Modes.I.turtle(),
Modes.I.twig(),
Modes.I.vb(),
Modes.I.vbscript(),
Modes.I.velocity(),
Modes.I.verilog(),
Modes.I.vhdl(),
Modes.I.vue(),
Modes.I.xml(),
Modes.I.xquery(),
Modes.I.yaml_frontmatter(),
Modes.I.yaml(),
Modes.I.z80(),
});
alias("application/x-httpd-php-open", "application/x-httpd-php");

View File

@@ -22,49 +22,122 @@ import com.google.gwt.resources.client.DataResource.DoNotEmbed;
public interface Modes extends ClientBundle {
public static final Modes I = GWT.create(Modes.class);
@Source("apl.js") @DoNotEmbed DataResource apl();
@Source("asciiarmor.js") @DoNotEmbed DataResource asciiarmor();
@Source("asn.1.js") @DoNotEmbed DataResource asn_1();
@Source("asterisk.js") @DoNotEmbed DataResource asterisk();
@Source("brainfuck.js") @DoNotEmbed DataResource brainfuck();
@Source("clike.js") @DoNotEmbed DataResource clike();
@Source("clojure.js") @DoNotEmbed DataResource clojure();
@Source("cmake.js") @DoNotEmbed DataResource cmake();
@Source("cobol.js") @DoNotEmbed DataResource cobol();
@Source("coffeescript.js") @DoNotEmbed DataResource coffeescript();
@Source("commonlisp.js") @DoNotEmbed DataResource commonlisp();
@Source("crystal.js") @DoNotEmbed DataResource crystal();
@Source("css.js") @DoNotEmbed DataResource css();
@Source("cypher.js") @DoNotEmbed DataResource cypher();
@Source("d.js") @DoNotEmbed DataResource d();
@Source("dart.js") @DoNotEmbed DataResource dart();
@Source("diff.js") @DoNotEmbed DataResource diff();
@Source("django.js") @DoNotEmbed DataResource django();
@Source("dockerfile.js") @DoNotEmbed DataResource dockerfile();
@Source("dtd.js") @DoNotEmbed DataResource dtd();
@Source("dylan.js") @DoNotEmbed DataResource dylan();
@Source("ebnf.js") @DoNotEmbed DataResource ebnf();
@Source("ecl.js") @DoNotEmbed DataResource ecl();
@Source("eiffel.js") @DoNotEmbed DataResource eiffel();
@Source("elm.js") @DoNotEmbed DataResource elm();
@Source("erlang.js") @DoNotEmbed DataResource erlang();
@Source("factor.js") @DoNotEmbed DataResource factor();
@Source("fcl.js") @DoNotEmbed DataResource fcl();
@Source("forth.js") @DoNotEmbed DataResource forth();
@Source("fortran.js") @DoNotEmbed DataResource fortran();
@Source("gas.js") @DoNotEmbed DataResource gas();
@Source("gerrit/commit.js") @DoNotEmbed DataResource gerrit_commit();
@Source("gfm.js") @DoNotEmbed DataResource gfm();
@Source("gherkin.js") @DoNotEmbed DataResource gherkin();
@Source("go.js") @DoNotEmbed DataResource go();
@Source("groovy.js") @DoNotEmbed DataResource groovy();
@Source("haml.js") @DoNotEmbed DataResource haml();
@Source("handlebars.js") @DoNotEmbed DataResource handlebars();
@Source("haskell-literate.js") @DoNotEmbed DataResource haskell_literate();
@Source("haskell.js") @DoNotEmbed DataResource haskell();
@Source("haxe.js") @DoNotEmbed DataResource haxe();
@Source("htmlembedded.js") @DoNotEmbed DataResource htmlembedded();
@Source("htmlmixed.js") @DoNotEmbed DataResource htmlmixed();
@Source("http.js") @DoNotEmbed DataResource http();
@Source("idl.js") @DoNotEmbed DataResource idl();
@Source("jade.js") @DoNotEmbed DataResource jade();
@Source("javascript.js") @DoNotEmbed DataResource javascript();
@Source("jinja2.js") @DoNotEmbed DataResource jinja2();
@Source("jsx.js") @DoNotEmbed DataResource jsx();
@Source("julia.js") @DoNotEmbed DataResource julia();
@Source("livescript.js") @DoNotEmbed DataResource livescript();
@Source("lua.js") @DoNotEmbed DataResource lua();
@Source("markdown.js") @DoNotEmbed DataResource markdown();
@Source("mathematica.js") @DoNotEmbed DataResource mathematica();
@Source("mirc.js") @DoNotEmbed DataResource mirc();
@Source("mllike.js") @DoNotEmbed DataResource mllike();
@Source("modelica.js") @DoNotEmbed DataResource modelica();
@Source("mscgen.js") @DoNotEmbed DataResource mscgen();
@Source("mumps.js") @DoNotEmbed DataResource mumps();
@Source("nginx.js") @DoNotEmbed DataResource nginx();
@Source("nsis.js") @DoNotEmbed DataResource nsis();
@Source("ntriples.js") @DoNotEmbed DataResource ntriples();
@Source("octave.js") @DoNotEmbed DataResource octave();
@Source("oz.js") @DoNotEmbed DataResource oz();
@Source("pascal.js") @DoNotEmbed DataResource pascal();
@Source("pegjs.js") @DoNotEmbed DataResource pegjs();
@Source("perl.js") @DoNotEmbed DataResource perl();
@Source("php.js") @DoNotEmbed DataResource php();
@Source("pig.js") @DoNotEmbed DataResource pig();
@Source("properties.js") @DoNotEmbed DataResource properties();
@Source("protobuf.js") @DoNotEmbed DataResource protobuf();
@Source("puppet.js") @DoNotEmbed DataResource puppet();
@Source("python.js") @DoNotEmbed DataResource python();
@Source("q.js") @DoNotEmbed DataResource q();
@Source("r.js") @DoNotEmbed DataResource r();
@Source("rpm.js") @DoNotEmbed DataResource rpm();
@Source("rst.js") @DoNotEmbed DataResource rst();
@Source("ruby.js") @DoNotEmbed DataResource ruby();
@Source("rust.js") @DoNotEmbed DataResource rust();
@Source("sass.js") @DoNotEmbed DataResource sass();
@Source("scheme.js") @DoNotEmbed DataResource scheme();
@Source("shell.js") @DoNotEmbed DataResource shell();
@Source("sieve.js") @DoNotEmbed DataResource sieve();
@Source("slim.js") @DoNotEmbed DataResource slim();
@Source("smalltalk.js") @DoNotEmbed DataResource smalltalk();
@Source("swift.js") @DoNotEmbed DataResource swift();
@Source("smarty.js") @DoNotEmbed DataResource smarty();
@Source("solr.js") @DoNotEmbed DataResource solr();
@Source("soy.js") @DoNotEmbed DataResource soy();
@Source("sparql.js") @DoNotEmbed DataResource sparql();
@Source("spreadsheet.js") @DoNotEmbed DataResource spreadsheet();
@Source("sql.js") @DoNotEmbed DataResource sql();
@Source("stex.js") @DoNotEmbed DataResource stex();
@Source("stylus.js") @DoNotEmbed DataResource stylus();
@Source("swift.js") @DoNotEmbed DataResource swift();
@Source("tcl.js") @DoNotEmbed DataResource tcl();
@Source("textile.js") @DoNotEmbed DataResource textile();
@Source("tiddlywiki.js") @DoNotEmbed DataResource tiddlywiki();
@Source("tiki.js") @DoNotEmbed DataResource tiki();
@Source("toml.js") @DoNotEmbed DataResource toml();
@Source("tornado.js") @DoNotEmbed DataResource tornado();
@Source("troff.js") @DoNotEmbed DataResource troff();
@Source("ttcn-cfg.js") @DoNotEmbed DataResource ttcn_cfg();
@Source("ttcn.js") @DoNotEmbed DataResource ttcn();
@Source("turtle.js") @DoNotEmbed DataResource turtle();
@Source("twig.js") @DoNotEmbed DataResource twig();
@Source("vb.js") @DoNotEmbed DataResource vb();
@Source("vbscript.js") @DoNotEmbed DataResource vbscript();
@Source("velocity.js") @DoNotEmbed DataResource velocity();
@Source("verilog.js") @DoNotEmbed DataResource verilog();
@Source("vhdl.js") @DoNotEmbed DataResource vhdl();
@Source("vue.js") @DoNotEmbed DataResource vue();
@Source("xml.js") @DoNotEmbed DataResource xml();
@Source("xquery.js") @DoNotEmbed DataResource xquery();
@Source("yaml-frontmatter.js") @DoNotEmbed DataResource yaml_frontmatter();
@Source("yaml.js") @DoNotEmbed DataResource yaml();
@Source("z80.js") @DoNotEmbed DataResource z80();
// When adding a resource, update static initializer in ModeInfo.
}

View File

@@ -1,57 +1,246 @@
apl = text/apl
as = text/x-gas
asn = text/x-ttcn-asn
asn1 = text/x-ttcn-asn
asp = application/x-aspx
aspx = application/x-aspx
asterisk = text/x-asterisk
b = text/x-brainfuck
bash = text/x-sh
bf = text/x-brainfuck
bnf = text/x-ebnf
bucklet = text/x-python
bzl = text/x-python
BUCK = text/x-python
clj = text/x-clojure
BUILD = text/x-python
c = text/x-csrc
cfg = text/x-ttcn-cfg
cl = text/x-common-lisp
clj = text/x-clojure
cljs = text/x-clojurescript
cmake = text/x-cmake
cmake.in = text/x-cmake
contributing.md = text/x-gfm
CMakeLists.txt = text/x-cmake
CONTRIBUTING.md = text/x-gfm
cob = text/x-cobol
coffee = text/x-coffeescript
conf = text/plain
cpy = text/x-cobol
cr = text/x-crystal
cs = text/x-csharp
csharp = text/x-csharp
css = text/css
cpp = text/x-c++src
cql = text/x-cassandra
cxx = text/x-c++src
cyp = application/x-cypher-query
cypher = application/x-cypher-query
c++ = text/x-c++src
d = text/x-d
dart = application/dart
def = text/plain
defs = text/x-python
diff = text/x-diff
django = text/x-django
dtd = application/xml-dtd
dyalog = text/apl
dyl = text/x-dylan
dylan = text/x-dylan
Dockerfile = text/x-dockerfile
dtd = application/xml-dtd
e = text/x-eiffel
ebnf = text/x-ebnf
ecl = text/x-ecl
el = text/x-common-lisp
elm = text/x-elm
ejs = application/x-ejs
erb = application/x-erb
erl = text/x-erlang
es6 = text/jsx
excel = text/x-spreadsheet
extensions.conf = text/x-asterisk
f = text/x-fortran
factor = text/x-factor
feathre = text/x-feature
fcl = text/x-fcl
for = text/x-fortran
formula = text/x-spreadsheet
forth = text/x-forth
fth = text/x-forth
frag = x-shader/x-fragment
fs = text/x-fsharp
fsharp = text/x-fsharp
f77 = text/x-fortran
f90 = text/x-fortran
gitmodules = text/x-ini
glsl = x-shader/x-vertex
go = text/x-go
gradle = text/x-groovy
groovy = text/x-groovy
hs = text/x-haskell
gss = text/x-gss
h = text/x-csrc
haml = text/x-haml
hh = text/x-c++src
history.md = text/x-gfm
hpp = text/x-c++src
hs = text/x-haskell
htm = text/html
html = text/html
http = message/http
hx = text/x-haxe
hxml = text/x-hxml
hxx = text/x-c++src
h++ = text/x-c++src
HISTORY.md = text/x-gfm
in = text/x-properties
ini = text/x-properties
intr = text/x-dylan
jade = text/x-jade
java = text/x-java
jl = text/x-julia
jruby = text/x-ruby
js = text/javascript
json = application/json
jsonld = application/ld+json
jsx = text/jsx
jsp = application/x-jsp
kt = text/x-kotlin
less = text/x-less
lhs = text/x-literate-haskell
lisp = text/x-common-lisp
list = text/plain
log = text/plain
ls = text/x-livescript
lsp = text/x-common-lisp
lua = text/x-lua
m = text/x-objectivec
macruby = text/x-ruby
map = application/json
markdown = text/x-markdown
md = text/x-markdown
mirc = text/mirc
mkd = text/x-markdown
ml = text/x-ocaml
mli = text/x-ocaml
mll = text/x-ocaml
mly = text/x-ocaml
mm = text/x-objectivec
mo = text/x-modelica
mps = text/x-mumps
msc = text/x-mscgen
mscgen = text/x-mscgen
mscin = text/x-mscgen
msgenny = text/x-msgenny
nb = text/x-mathematica
nginx.conf = text/x-nginx-conf
nsh = text/x-nsis
nsi = text/x-nsis
nt = text/n-triples
nut = text/x-squirrel
oz = text/x-oz
p = text/x-pascal
pas = text/x-pascal
patch = text/x-diff
pgp = application/pgp
php = text/x-php
php3 = text/x-php
php4 = text/x-php
php5 = text/x-php
phtml = text/x-php
pig = text/x-pig
pl = text/x-perl
pls = text/x-plsql
pm = text/x-perl
pp = text/x-puppet
pro = text/x-idl
project.config = text/x-ini
properties = text/x-ini
proto = text/x-protobuf
protobuf = text/x-protobuf
py = text/x-python
pyw = text/x-python
pyx = text/x-cython
pxd = text/x-cython
pxi = text/x-cython
PKGBUILD = text/x-sh
q = text/x-q
r = text/r-src
rake = text/x-ruby
rb = text/x-ruby
rbx = text/x-ruby
readme.md = text/x-gfm
rng = application/xml
rpm = text/x-rpm-changes
rq = application/sparql-query
rs = text/x-rustsrc
rss = application/xml
rst = text/x-rst
README.md = text/x-gfm
s = text/x-gas
sass = text/x-sass
scala = text/x-scala
scm = text/x-scheme
scss = text/x-scss
sh = text/x-sh
sieve = application/sieve
siv = application/sieve
slim = text/x-slim
solr = text/x-solr
soy = text/x-soy
sparql = application/sparql-query
sparul = applicatoin/sparql-query
spec = text/x-rpm-spec
spreadsheet = text/x-spreadsheet
sql = text/x-sql
ss = text/x-scheme
st = text/x-stsrc
stex = text/x-stex
swift = text/x-swift
tcl = text/x-tcl
tex = text/x-latex
text = text/plain
textile = text/x-textile
tiddly = text/x-tiddlywiki
tiddlywiki = text/x-tiddlywiki
tiki = text/tiki
toml = text/x-toml
tpl = text/x-smarty
ts = application/typescript
ttcn = text/x-ttcn
ttcnpp = text/x-ttcn
ttcn3 = text/x-ttcn
ttl = text/turtle
txt = text/plain
twig = text/x-twig
v = text/x-verilog
vb = text/x-vb
vbs = text/vbscript
vert = x-shader/x-vertex
vh = text/x-verilog
vhd = text/x-vhdl
vhdl = text/x-vhdl
vm = text/velocity
vtl = text/velocity
wsdl = application/xml
xhtml = text/html
xml = application/xml
xsd = application/xml
xsl = application/xml
xquery = application/xquery
xu = text/x-xu
xy = application/xquery
yaml = text/x-yaml
yml = text/x-yaml
zsh = text/x-sh
z80 = text/x-z80
1 = text/troff
2 = text/troff
3 = text/troff
4 = text/troff
4th = text/x-forth
5 = text/troff
6 = text/troff
7 = text/troff
8 = text/troff
9 = text/troff

View File

@@ -44,46 +44,119 @@ CM_THEMES = [
# gerrit-gwtui/src/main/java/net/codemirror/mode/ModeInfo.java,
# and in CodeMirror's own mode/meta.js script.
CM_MODES = [
'apl',
'asciiarmor',
'asn.1',
'asterisk',
'brainfuck',
'clike',
'clojure',
'cmake',
'cobol',
'coffeescript',
'commonlisp',
'crystal',
'css',
'cypher',
'd',
'dart',
'diff',
'django',
'dockerfile',
'dtd',
'dylan',
'ebnf',
'ecl',
'eiffel',
'elm',
'erlang',
'factor',
'fcl',
'forth',
'fortran',
'gas',
'gfm',
'gherkin',
'go',
'groovy',
'haml',
'handlebars',
'haskell-literate',
'haskell',
'haxe',
'htmlembedded',
'htmlmixed',
'http',
'idl',
'jade',
'javascript',
'jinja2',
'jsx',
'julia',
'livescript',
'lua',
'markdown',
'mathematica',
'mirc',
'mllike',
'modelica',
'mscgen',
'mumps',
'nginx',
'nsis',
'ntriples',
'octave',
'oz',
'pascal',
'pegjs',
'perl',
'php',
'pig',
'properties',
'protobuf',
'puppet',
'python',
'q',
'r',
'rpm',
'rst',
'ruby',
'rust',
'sass',
'scheme',
'shell',
'sieve',
'slim',
'smalltalk',
'smarty',
'solr',
'soy',
'sparql',
'spreadsheet',
'sql',
'stex',
'stylus',
'swift',
'tcl',
'textile',
'tiddlywiki',
'tiki',
'toml',
'tornado',
'troff',
'ttcn-cfg',
'ttcn',
'turtle',
'twig',
'vb',
'vbscript',
'velocity',
'verilog',
'vhdl',
'vue',
'xml',
'xquery',
'yaml-frontmatter',
'yaml',
'z80',
]