2016-03-13 23:26:27 +00:00
|
|
|
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
|
2014-07-08 20:15:22 +00:00
|
|
|
"use strict";
|
2013-12-30 15:00:16 +00:00
|
|
|
|
|
|
|
var modes = [];
|
|
|
|
function getModeForPath(path) {
|
|
|
|
var mode = modesByName.text;
|
|
|
|
var fileName = path.split(/[\/\\]/).pop();
|
|
|
|
for (var i = 0; i < modes.length; i++) {
|
|
|
|
if (modes[i].supportsFile(fileName)) {
|
|
|
|
mode = modes[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
var Mode = function(name, caption, extensions) {
|
|
|
|
this.name = name;
|
|
|
|
this.caption = caption;
|
|
|
|
this.mode = "ace/mode/" + name;
|
|
|
|
this.extensions = extensions;
|
2016-03-13 23:26:27 +00:00
|
|
|
var re;
|
2013-12-30 15:00:16 +00:00
|
|
|
if (/\^/.test(extensions)) {
|
2016-03-13 23:26:27 +00:00
|
|
|
re = extensions.replace(/\|(\^)?/g, function(a, b){
|
2013-12-30 15:00:16 +00:00
|
|
|
return "$|" + (b ? "^" : "^.*\\.");
|
|
|
|
}) + "$";
|
|
|
|
} else {
|
2016-03-13 23:26:27 +00:00
|
|
|
re = "^.*\\.(" + extensions + ")$";
|
2013-12-30 15:00:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.extRe = new RegExp(re, "gi");
|
|
|
|
};
|
|
|
|
|
|
|
|
Mode.prototype.supportsFile = function(filename) {
|
|
|
|
return filename.match(this.extRe);
|
|
|
|
};
|
|
|
|
var supportedModes = {
|
|
|
|
ABAP: ["abap"],
|
2014-07-08 20:15:22 +00:00
|
|
|
ABC: ["abc"],
|
2013-12-30 15:00:16 +00:00
|
|
|
ActionScript:["as"],
|
|
|
|
ADA: ["ada|adb"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Alda: ["alda"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Apex: ["apex|cls|trigger|tgr"],
|
|
|
|
AQL: ["aql"],
|
2015-11-19 16:37:40 +00:00
|
|
|
AsciiDoc: ["asciidoc|adoc"],
|
2020-04-14 12:14:48 +00:00
|
|
|
ASL: ["dsl|asl"],
|
2015-11-19 16:37:40 +00:00
|
|
|
Assembly_x86:["asm|a"],
|
2013-12-30 15:00:16 +00:00
|
|
|
AutoHotKey: ["ahk"],
|
|
|
|
BatchFile: ["bat|cmd"],
|
2015-11-19 16:37:40 +00:00
|
|
|
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
2013-12-30 15:00:16 +00:00
|
|
|
C9Search: ["c9search_results"],
|
2014-03-16 18:05:39 +00:00
|
|
|
Cirru: ["cirru|cr"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Clojure: ["clj|cljs"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Cobol: ["CBL|COB"],
|
|
|
|
coffee: ["coffee|cf|cson|^Cakefile"],
|
|
|
|
ColdFusion: ["cfm"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Crystal: ["cr"],
|
2013-12-30 15:00:16 +00:00
|
|
|
CSharp: ["cs"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Csound_Document: ["csd"],
|
|
|
|
Csound_Orchestra: ["orc"],
|
|
|
|
Csound_Score: ["sco"],
|
2013-12-30 15:00:16 +00:00
|
|
|
CSS: ["css"],
|
|
|
|
Curly: ["curly"],
|
|
|
|
D: ["d|di"],
|
|
|
|
Dart: ["dart"],
|
|
|
|
Diff: ["diff|patch"],
|
2014-04-29 09:03:14 +00:00
|
|
|
Dockerfile: ["^Dockerfile"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Dot: ["dot"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Drools: ["drl"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Edifact: ["edi"],
|
2015-11-19 16:37:40 +00:00
|
|
|
Eiffel: ["e|ge"],
|
2013-12-30 15:00:16 +00:00
|
|
|
EJS: ["ejs"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Elixir: ["ex|exs"],
|
|
|
|
Elm: ["elm"],
|
|
|
|
Erlang: ["erl|hrl"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Forth: ["frt|fs|ldr|fth|4th"],
|
2016-03-13 23:26:27 +00:00
|
|
|
Fortran: ["f|f90"],
|
2020-04-14 12:14:48 +00:00
|
|
|
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
|
|
|
FSL: ["fsl"],
|
2013-12-30 15:00:16 +00:00
|
|
|
FTL: ["ftl"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Gcode: ["gcode"],
|
2014-03-16 18:05:39 +00:00
|
|
|
Gherkin: ["feature"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Gitignore: ["^.gitignore"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Glsl: ["glsl|frag|vert"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Gobstones: ["gbs"],
|
2013-12-30 15:00:16 +00:00
|
|
|
golang: ["go"],
|
2017-02-05 20:05:00 +00:00
|
|
|
GraphQLSchema: ["gql"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Groovy: ["groovy"],
|
|
|
|
HAML: ["haml"],
|
|
|
|
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
|
|
|
Haskell: ["hs"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Haskell_Cabal: ["cabal"],
|
2013-12-30 15:00:16 +00:00
|
|
|
haXe: ["hx"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Hjson: ["hjson"],
|
2020-04-14 12:14:48 +00:00
|
|
|
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
2015-11-19 16:37:40 +00:00
|
|
|
HTML_Elixir: ["eex|html.eex"],
|
2016-03-13 23:26:27 +00:00
|
|
|
HTML_Ruby: ["erb|rhtml|html.erb"],
|
2013-12-30 15:00:16 +00:00
|
|
|
INI: ["ini|conf|cfg|prefs"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Io: ["io"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Jack: ["jack"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Jade: ["jade|pug"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Java: ["java"],
|
2015-11-19 16:37:40 +00:00
|
|
|
JavaScript: ["js|jsm|jsx"],
|
2013-12-30 15:00:16 +00:00
|
|
|
JSON: ["json"],
|
2020-04-14 12:14:48 +00:00
|
|
|
JSON5: ["json5"],
|
2013-12-30 15:00:16 +00:00
|
|
|
JSONiq: ["jq"],
|
|
|
|
JSP: ["jsp"],
|
2020-04-14 12:14:48 +00:00
|
|
|
JSSM: ["jssm|jssm_state"],
|
2013-12-30 15:00:16 +00:00
|
|
|
JSX: ["jsx"],
|
|
|
|
Julia: ["jl"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Kotlin: ["kt|kts"],
|
2013-12-30 15:00:16 +00:00
|
|
|
LaTeX: ["tex|latex|ltx|bib"],
|
|
|
|
LESS: ["less"],
|
|
|
|
Liquid: ["liquid"],
|
|
|
|
Lisp: ["lisp"],
|
|
|
|
LiveScript: ["ls"],
|
|
|
|
LogiQL: ["logic|lql"],
|
|
|
|
LSL: ["lsl"],
|
|
|
|
Lua: ["lua"],
|
|
|
|
LuaPage: ["lp"],
|
|
|
|
Lucene: ["lucene"],
|
|
|
|
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
|
|
|
Markdown: ["md|markdown"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Mask: ["mask"],
|
|
|
|
MATLAB: ["matlab"],
|
2015-11-19 16:37:40 +00:00
|
|
|
Maze: ["mz"],
|
2020-04-14 12:14:48 +00:00
|
|
|
MediaWiki: ["wiki|mediawiki"],
|
2013-12-30 15:00:16 +00:00
|
|
|
MEL: ["mel"],
|
2020-04-14 12:14:48 +00:00
|
|
|
MIXAL: ["mixal"],
|
2013-12-30 15:00:16 +00:00
|
|
|
MUSHCode: ["mc|mush"],
|
2014-07-08 20:15:22 +00:00
|
|
|
MySQL: ["mysql"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Nginx: ["nginx|conf"],
|
|
|
|
Nim: ["nim"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Nix: ["nix"],
|
2016-03-13 23:26:27 +00:00
|
|
|
NSIS: ["nsi|nsh"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Nunjucks: ["nunjucks|nunjs|nj|njk"],
|
2013-12-30 15:00:16 +00:00
|
|
|
ObjectiveC: ["m|mm"],
|
|
|
|
OCaml: ["ml|mli"],
|
|
|
|
Pascal: ["pas|p"],
|
|
|
|
Perl: ["pl|pm"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Perl6: ["p6|pl6|pm6"],
|
2013-12-30 15:00:16 +00:00
|
|
|
pgSQL: ["pgsql"],
|
2020-04-14 12:14:48 +00:00
|
|
|
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
|
|
|
PHP_Laravel_blade: ["blade.php"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Pig: ["pig"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Powershell: ["ps1"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Praat: ["praat|praatscript|psc|proc"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Prisma: ["prisma"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Prolog: ["plg|prolog"],
|
|
|
|
Properties: ["properties"],
|
|
|
|
Protobuf: ["proto"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Puppet: ["epp|pp"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Python: ["py"],
|
2020-04-14 12:14:48 +00:00
|
|
|
QML: ["qml"],
|
2013-12-30 15:00:16 +00:00
|
|
|
R: ["r"],
|
2017-02-05 20:05:00 +00:00
|
|
|
Razor: ["cshtml|asp"],
|
2013-12-30 15:00:16 +00:00
|
|
|
RDoc: ["Rd"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Red: ["red|reds"],
|
2013-12-30 15:00:16 +00:00
|
|
|
RHTML: ["Rhtml"],
|
2016-03-13 23:26:27 +00:00
|
|
|
RST: ["rst"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
|
|
|
Rust: ["rs"],
|
|
|
|
SASS: ["sass"],
|
|
|
|
SCAD: ["scad"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Scala: ["scala|sbt"],
|
2015-11-19 16:37:40 +00:00
|
|
|
Scheme: ["scm|sm|rkt|oak|scheme"],
|
2013-12-30 15:00:16 +00:00
|
|
|
SCSS: ["scss"],
|
|
|
|
SH: ["sh|bash|^.bashrc"],
|
|
|
|
SJS: ["sjs"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Slim: ["slim|skim"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Smarty: ["smarty|tpl"],
|
2013-12-30 15:00:16 +00:00
|
|
|
snippets: ["snippets"],
|
|
|
|
Soy_Template:["soy"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Space: ["space"],
|
2013-12-30 15:00:16 +00:00
|
|
|
SQL: ["sql"],
|
2015-11-19 16:37:40 +00:00
|
|
|
SQLServer: ["sqlserver"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Stylus: ["styl|stylus"],
|
|
|
|
SVG: ["svg"],
|
2015-11-19 16:37:40 +00:00
|
|
|
Swift: ["swift"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Tcl: ["tcl"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Terraform: ["tf", "tfvars", "terragrunt"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Tex: ["tex"],
|
|
|
|
Text: ["txt"],
|
|
|
|
Textile: ["textile"],
|
|
|
|
Toml: ["toml"],
|
2017-02-05 20:05:00 +00:00
|
|
|
TSX: ["tsx"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Twig: ["latte|twig|swig"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Typescript: ["ts|typescript|str"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Vala: ["vala"],
|
|
|
|
VBScript: ["vbs|vb"],
|
2013-12-30 15:00:16 +00:00
|
|
|
Velocity: ["vm"],
|
|
|
|
Verilog: ["v|vh|sv|svh"],
|
2014-07-08 20:15:22 +00:00
|
|
|
VHDL: ["vhd|vhdl"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Visualforce: ["vfp|component|page"],
|
2016-03-13 23:26:27 +00:00
|
|
|
Wollok: ["wlk|wpgm|wtest"],
|
2015-11-19 16:37:40 +00:00
|
|
|
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
2013-12-30 15:00:16 +00:00
|
|
|
XQuery: ["xq"],
|
2014-07-08 20:15:22 +00:00
|
|
|
YAML: ["yaml|yml"],
|
2020-04-14 12:14:48 +00:00
|
|
|
Zeek: ["zeek|bro"],
|
2014-07-08 20:15:22 +00:00
|
|
|
Django: ["html"]
|
2013-12-30 15:00:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var nameOverrides = {
|
|
|
|
ObjectiveC: "Objective-C",
|
|
|
|
CSharp: "C#",
|
|
|
|
golang: "Go",
|
2014-07-08 20:15:22 +00:00
|
|
|
C_Cpp: "C and C++",
|
2020-04-14 12:14:48 +00:00
|
|
|
Csound_Document: "Csound Document",
|
|
|
|
Csound_Orchestra: "Csound",
|
|
|
|
Csound_Score: "Csound Score",
|
2013-12-30 15:00:16 +00:00
|
|
|
coffee: "CoffeeScript",
|
|
|
|
HTML_Ruby: "HTML (Ruby)",
|
2015-11-19 16:37:40 +00:00
|
|
|
HTML_Elixir: "HTML (Elixir)",
|
2020-04-14 12:14:48 +00:00
|
|
|
FTL: "FreeMarker",
|
|
|
|
PHP_Laravel_blade: "PHP (Blade Template)",
|
|
|
|
Perl6: "Perl 6",
|
|
|
|
AutoHotKey: "AutoHotkey / AutoIt"
|
2013-12-30 15:00:16 +00:00
|
|
|
};
|
|
|
|
var modesByName = {};
|
|
|
|
for (var name in supportedModes) {
|
|
|
|
var data = supportedModes[name];
|
|
|
|
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
|
|
|
|
var filename = name.toLowerCase();
|
|
|
|
var mode = new Mode(filename, displayName, data[0]);
|
|
|
|
modesByName[filename] = mode;
|
|
|
|
modes.push(mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getModeForPath: getModeForPath,
|
|
|
|
modes: modes,
|
|
|
|
modesByName: modesByName
|
|
|
|
};
|
|
|
|
|
2020-04-14 12:14:48 +00:00
|
|
|
}); (function() {
|
|
|
|
ace.require(["ace/ext/modelist"], function(m) {
|
|
|
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
|
|
module.exports = m;
|
|
|
|
}
|
|
|
|
});
|
2014-07-08 20:15:22 +00:00
|
|
|
})();
|
|
|
|
|