| 1 |
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict"; |
| 2 |
var modes = []; |
| 3 |
function getModeForPath(path) { |
| 4 |
var mode = modesByName.text; |
| 5 |
var fileName = path.split(/[\/\\]/).pop(); |
| 6 |
for (var i = 0; i < modes.length; i++) { |
| 7 |
if (modes[i].supportsFile(fileName)) { |
| 8 |
mode = modes[i]; |
| 9 |
break; |
| 10 |
} |
| 11 |
} |
| 12 |
return mode; |
| 13 |
} |
| 14 |
var Mode = (function () { |
| 15 |
function Mode(name, caption, extensions) { |
| 16 |
this.name = name; |
| 17 |
this.caption = caption; |
| 18 |
this.mode = "ace/mode/" + name; |
| 19 |
this.extensions = extensions; |
| 20 |
var re; |
| 21 |
if (/\^/.test(extensions)) { |
| 22 |
re = extensions.replace(/\|(\^)?/g, function (a, b) { |
| 23 |
return "$|" + (b ? "^" : "^.*\\."); |
| 24 |
}) + "$"; |
| 25 |
} |
| 26 |
else { |
| 27 |
re = "^.*\\.(" + extensions + ")$"; |
| 28 |
} |
| 29 |
this.extRe = new RegExp(re, "gi"); |
| 30 |
} |
| 31 |
Mode.prototype.supportsFile = function (filename) { |
| 32 |
return filename.match(this.extRe); |
| 33 |
}; |
| 34 |
return Mode; |
| 35 |
}()); |
| 36 |
var supportedModes = { |
| 37 |
ABAP: ["abap"], |
| 38 |
ABC: ["abc"], |
| 39 |
ActionScript: ["as"], |
| 40 |
ADA: ["ada|adb"], |
| 41 |
Alda: ["alda"], |
| 42 |
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], |
| 43 |
Apex: ["apex|cls|trigger|tgr"], |
| 44 |
AQL: ["aql"], |
| 45 |
AsciiDoc: ["asciidoc|adoc"], |
| 46 |
ASL: ["dsl|asl|asl.json"], |
| 47 |
Assembly_ARM32: ["s"], |
| 48 |
Assembly_x86: ["asm|a"], |
| 49 |
Astro: ["astro"], |
| 50 |
AutoHotKey: ["ahk"], |
| 51 |
BatchFile: ["bat|cmd"], |
| 52 |
BibTeX: ["bib"], |
| 53 |
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"], |
| 54 |
C9Search: ["c9search_results"], |
| 55 |
Cirru: ["cirru|cr"], |
| 56 |
Clojure: ["clj|cljs"], |
| 57 |
Cobol: ["CBL|COB"], |
| 58 |
coffee: ["coffee|cf|cson|^Cakefile"], |
| 59 |
ColdFusion: ["cfm|cfc"], |
| 60 |
Crystal: ["cr"], |
| 61 |
CSharp: ["cs"], |
| 62 |
Csound_Document: ["csd"], |
| 63 |
Csound_Orchestra: ["orc"], |
| 64 |
Csound_Score: ["sco"], |
| 65 |
CSS: ["css"], |
| 66 |
Curly: ["curly"], |
| 67 |
Cuttlefish: ["conf"], |
| 68 |
D: ["d|di"], |
| 69 |
Dart: ["dart"], |
| 70 |
Diff: ["diff|patch"], |
| 71 |
Django: ["djt|html.djt|dj.html|djhtml"], |
| 72 |
Dockerfile: ["^Dockerfile"], |
| 73 |
Dot: ["dot"], |
| 74 |
Drools: ["drl"], |
| 75 |
Edifact: ["edi"], |
| 76 |
Eiffel: ["e|ge"], |
| 77 |
EJS: ["ejs"], |
| 78 |
Elixir: ["ex|exs"], |
| 79 |
Elm: ["elm"], |
| 80 |
Erlang: ["erl|hrl"], |
| 81 |
Flix: ["flix"], |
| 82 |
Forth: ["frt|fs|ldr|fth|4th"], |
| 83 |
Fortran: ["f|f90"], |
| 84 |
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"], |
| 85 |
FSL: ["fsl"], |
| 86 |
FTL: ["ftl"], |
| 87 |
Gcode: ["gcode"], |
| 88 |
Gherkin: ["feature"], |
| 89 |
Gitignore: ["^.gitignore"], |
| 90 |
Glsl: ["glsl|frag|vert"], |
| 91 |
Gobstones: ["gbs"], |
| 92 |
golang: ["go"], |
| 93 |
GraphQLSchema: ["gql"], |
| 94 |
Groovy: ["groovy"], |
| 95 |
HAML: ["haml"], |
| 96 |
Handlebars: ["hbs|handlebars|tpl|mustache"], |
| 97 |
Haskell: ["hs"], |
| 98 |
Haskell_Cabal: ["cabal"], |
| 99 |
haXe: ["hx"], |
| 100 |
Hjson: ["hjson"], |
| 101 |
HTML: ["html|htm|xhtml|we|wpy"], |
| 102 |
HTML_Elixir: ["eex|html.eex"], |
| 103 |
HTML_Ruby: ["erb|rhtml|html.erb"], |
| 104 |
INI: ["ini|conf|cfg|prefs"], |
| 105 |
Io: ["io"], |
| 106 |
Ion: ["ion"], |
| 107 |
Jack: ["jack"], |
| 108 |
Jade: ["jade|pug"], |
| 109 |
Java: ["java"], |
| 110 |
JavaScript: ["js|jsm|cjs|mjs"], |
| 111 |
JEXL: ["jexl"], |
| 112 |
JSON: ["json"], |
| 113 |
JSON5: ["json5"], |
| 114 |
JSONiq: ["jq"], |
| 115 |
JSP: ["jsp"], |
| 116 |
JSSM: ["jssm|jssm_state"], |
| 117 |
JSX: ["jsx"], |
| 118 |
Julia: ["jl"], |
| 119 |
Kotlin: ["kt|kts"], |
| 120 |
LaTeX: ["tex|latex|ltx|bib"], |
| 121 |
Latte: ["latte"], |
| 122 |
LESS: ["less"], |
| 123 |
Liquid: ["liquid"], |
| 124 |
Lisp: ["lisp"], |
| 125 |
LiveScript: ["ls"], |
| 126 |
Log: ["log"], |
| 127 |
LogiQL: ["logic|lql"], |
| 128 |
Logtalk: ["lgt"], |
| 129 |
LSL: ["lsl"], |
| 130 |
Lua: ["lua"], |
| 131 |
LuaPage: ["lp"], |
| 132 |
Lucene: ["lucene"], |
| 133 |
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], |
| 134 |
Markdown: ["md|markdown"], |
| 135 |
Mask: ["mask"], |
| 136 |
MATLAB: ["matlab"], |
| 137 |
Maze: ["mz"], |
| 138 |
MediaWiki: ["wiki|mediawiki"], |
| 139 |
MEL: ["mel"], |
| 140 |
MIPS: ["s|asm"], |
| 141 |
MIXAL: ["mixal"], |
| 142 |
MUSHCode: ["mc|mush"], |
| 143 |
MySQL: ["mysql"], |
| 144 |
Nasal: ["nas"], |
| 145 |
Nginx: ["nginx|conf"], |
| 146 |
Nim: ["nim"], |
| 147 |
Nix: ["nix"], |
| 148 |
NSIS: ["nsi|nsh"], |
| 149 |
Nunjucks: ["nunjucks|nunjs|nj|njk"], |
| 150 |
ObjectiveC: ["m|mm"], |
| 151 |
OCaml: ["ml|mli"], |
| 152 |
Odin: ["odin"], |
| 153 |
PartiQL: ["partiql|pql"], |
| 154 |
Pascal: ["pas|p"], |
| 155 |
Perl: ["pl|pm"], |
| 156 |
pgSQL: ["pgsql"], |
| 157 |
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"], |
| 158 |
PHP_Laravel_blade: ["blade.php"], |
| 159 |
Pig: ["pig"], |
| 160 |
PLSQL: ["plsql"], |
| 161 |
Powershell: ["ps1"], |
| 162 |
Praat: ["praat|praatscript|psc|proc"], |
| 163 |
Prisma: ["prisma"], |
| 164 |
Prolog: ["plg|prolog"], |
| 165 |
Properties: ["properties"], |
| 166 |
Protobuf: ["proto"], |
| 167 |
PRQL: ["prql"], |
| 168 |
Puppet: ["epp|pp"], |
| 169 |
Python: ["py"], |
| 170 |
QML: ["qml"], |
| 171 |
R: ["r"], |
| 172 |
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"], |
| 173 |
Razor: ["cshtml|asp"], |
| 174 |
RDoc: ["Rd"], |
| 175 |
Red: ["red|reds"], |
| 176 |
RHTML: ["Rhtml"], |
| 177 |
Robot: ["robot|resource"], |
| 178 |
RST: ["rst"], |
| 179 |
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], |
| 180 |
Rust: ["rs"], |
| 181 |
SaC: ["sac"], |
| 182 |
SASS: ["sass"], |
| 183 |
SCAD: ["scad"], |
| 184 |
Scala: ["scala|sbt"], |
| 185 |
Scheme: ["scm|sm|rkt|oak|scheme"], |
| 186 |
Scrypt: ["scrypt"], |
| 187 |
SCSS: ["scss"], |
| 188 |
SH: ["sh|bash|^.bashrc"], |
| 189 |
SJS: ["sjs"], |
| 190 |
Slim: ["slim|skim"], |
| 191 |
Smarty: ["smarty|tpl"], |
| 192 |
Smithy: ["smithy"], |
| 193 |
snippets: ["snippets"], |
| 194 |
Soy_Template: ["soy"], |
| 195 |
Space: ["space"], |
| 196 |
SPARQL: ["rq"], |
| 197 |
SQL: ["sql"], |
| 198 |
SQLServer: ["sqlserver"], |
| 199 |
Stylus: ["styl|stylus"], |
| 200 |
SVG: ["svg"], |
| 201 |
Swift: ["swift"], |
| 202 |
Tcl: ["tcl"], |
| 203 |
Terraform: ["tf", "tfvars", "terragrunt"], |
| 204 |
Tex: ["tex"], |
| 205 |
Text: ["txt"], |
| 206 |
Textile: ["textile"], |
| 207 |
Toml: ["toml"], |
| 208 |
TSX: ["tsx"], |
| 209 |
Turtle: ["ttl"], |
| 210 |
Twig: ["twig|swig"], |
| 211 |
Typescript: ["ts|mts|cts|typescript|str"], |
| 212 |
Vala: ["vala"], |
| 213 |
VBScript: ["vbs|vb"], |
| 214 |
Velocity: ["vm"], |
| 215 |
Verilog: ["v|vh|sv|svh"], |
| 216 |
VHDL: ["vhd|vhdl"], |
| 217 |
Visualforce: ["vfp|component|page"], |
| 218 |
Vue: ["vue"], |
| 219 |
Wollok: ["wlk|wpgm|wtest"], |
| 220 |
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], |
| 221 |
XQuery: ["xq"], |
| 222 |
YAML: ["yaml|yml"], |
| 223 |
Zeek: ["zeek|bro"], |
| 224 |
Zig: ["zig"] |
| 225 |
}; |
| 226 |
var nameOverrides = { |
| 227 |
ObjectiveC: "Objective-C", |
| 228 |
CSharp: "C#", |
| 229 |
golang: "Go", |
| 230 |
C_Cpp: "C and C++", |
| 231 |
Csound_Document: "Csound Document", |
| 232 |
Csound_Orchestra: "Csound", |
| 233 |
Csound_Score: "Csound Score", |
| 234 |
coffee: "CoffeeScript", |
| 235 |
HTML_Ruby: "HTML (Ruby)", |
| 236 |
HTML_Elixir: "HTML (Elixir)", |
| 237 |
FTL: "FreeMarker", |
| 238 |
PHP_Laravel_blade: "PHP (Blade Template)", |
| 239 |
Perl6: "Perl 6", |
| 240 |
AutoHotKey: "AutoHotkey / AutoIt" |
| 241 |
}; |
| 242 |
var modesByName = {}; |
| 243 |
for (var name in supportedModes) { |
| 244 |
var data = supportedModes[name]; |
| 245 |
var displayName = (nameOverrides[name] || name).replace(/_/g, " "); |
| 246 |
var filename = name.toLowerCase(); |
| 247 |
var mode = new Mode(filename, displayName, data[0]); |
| 248 |
modesByName[filename] = mode; |
| 249 |
modes.push(mode); |
| 250 |
} |
| 251 |
module.exports = { |
| 252 |
getModeForPath: getModeForPath, |
| 253 |
modes: modes, |
| 254 |
modesByName: modesByName |
| 255 |
}; |
| 256 |
|
| 257 |
}); (function() { |
| 258 |
ace.require(["ace/ext/modelist"], function(m) { |
| 259 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 260 |
module.exports = m; |
| 261 |
} |
| 262 |
}); |
| 263 |
})(); |
| 264 |
|