d490f49224338e11ac3ff8e498b46b64.js 6.6 KB

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