2015-02-10 19:41:24 +00:00
|
|
|
define(function(require, exports, module) {
|
|
|
|
|
|
|
|
var modesByName = require("ace/ext/modelist").modesByName;
|
|
|
|
|
|
|
|
modesByName.javascript.extensions += "|run|build";
|
|
|
|
|
|
|
|
var primaryModes = ["c_cpp","clojure","coffee","csharp","css","dart","golang",
|
|
|
|
"html","jade","java","javascript","json","less","lua","perl","php","python",
|
|
|
|
"ruby","scala","scss","sh","stylus","sql","text","typescript","xml","xquery",
|
|
|
|
"yaml"];
|
|
|
|
|
|
|
|
var hiddenModes = ["text", "snippets"];
|
|
|
|
var fileExtensions = Object.create(null);
|
|
|
|
var modesByCaption = Object.create(null);
|
|
|
|
var customExtensions = Object.create(null);
|
|
|
|
Object.keys(modesByName).forEach(function(name) {
|
|
|
|
var mode = modesByName[name];
|
|
|
|
modesByCaption[mode.caption] = mode;
|
|
|
|
|
|
|
|
mode.id = name;
|
|
|
|
if (primaryModes.indexOf(mode.name) != -1)
|
|
|
|
mode.order = 100000;
|
|
|
|
else if (hiddenModes.indexOf(mode.name) != -1)
|
|
|
|
mode.order = -1;
|
|
|
|
else
|
|
|
|
mode.order = 0;
|
|
|
|
|
|
|
|
mode.extensions.split("|").forEach(function(ext) {
|
2015-04-21 23:28:58 +00:00
|
|
|
if (!fileExtensions[ext])
|
|
|
|
fileExtensions[ext] = name;
|
2015-02-10 19:41:24 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
byName: modesByName,
|
|
|
|
extensions: fileExtensions,
|
|
|
|
customExtensions: customExtensions,
|
|
|
|
byCaption: modesByCaption
|
|
|
|
}
|
|
|
|
});
|