Skip to content

Commit

Permalink
add scope to snippets.js files
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Jun 5, 2013
1 parent c2b7d1f commit c223f59
Show file tree
Hide file tree
Showing 117 changed files with 262 additions and 108 deletions.
56 changes: 28 additions & 28 deletions Makefile.dryice.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function ace() {
source: ACE_HOME + "/ChangeLog.txt",
dest: BUILD_DIR + "/ChangeLog.txt"
});

return project;
}

Expand Down Expand Up @@ -211,7 +211,7 @@ function demo(project) {
});

var demo = copy.createDataObject();

project.assumeAllFilesLoaded();
copy({
source: [{
Expand Down Expand Up @@ -309,7 +309,7 @@ var buildAce = function(options) {
for(var key in defaults)
if (!options.hasOwnProperty(key))
options[key] = defaults[key];

generateThemesModule(options.themes);

addSuffix(options);
Expand All @@ -334,7 +334,7 @@ var buildAce = function(options) {
filter: [ copy.filter.moduleDefines ],
dest: ace
});

if (options.coreOnly)
return project;

Expand All @@ -349,7 +349,7 @@ var buildAce = function(options) {
project.assumeAllFilesLoaded();
options.modes.forEach(function(mode) {
console.log("mode " + mode);
addSnippetFile(mode, project, targetDir, options);
addSnippetFile(mode, project, targetDir, options);
copy({
source: [{
project: cloneProject(project),
Expand Down Expand Up @@ -442,7 +442,7 @@ var buildAce = function(options) {
dest: BUILD_DIR + '/ace-min.js'
});
}

return project;
};

Expand All @@ -462,27 +462,27 @@ var buildAce = function(fn) {
}(buildAce);

var addSnippetFile = function(modeName, project, targetDir, options) {
var snippetFilePath = ACE_HOME + "/lib/ace/snippets/" + modeName;
if (!fs.existsSync(snippetFilePath + ".js")) {
copy({
source: ACE_HOME + "/tool/snippet.tmpl.js",
dest: snippetFilePath + ".js",
filter: [
function(t) {return t.replace("%modeName%", modeName);}
]
});
}
if (!fs.existsSync(snippetFilePath + ".snippets")) {
fs.writeFileSync(snippetFilePath + ".snippets", "")
}
copy({
source: [{
project: cloneProject(project),
require: [ 'ace/snippets/' + modeName ]
}],
filter: getWriteFilters(options, "mode"),
dest: targetDir + "/snippets/" + modeName + ".js"
});
var snippetFilePath = ACE_HOME + "/lib/ace/snippets/" + modeName;
if (!fs.existsSync(snippetFilePath + ".js")) {
copy({
source: ACE_HOME + "/tool/snippets.tmpl.js",
dest: snippetFilePath + ".js",
filter: [
function(t) {return t.replace(/%modeName%/g, modeName);}
]
});
}
if (!fs.existsSync(snippetFilePath + ".snippets")) {
fs.writeFileSync(snippetFilePath + ".snippets", "")
}
copy({
source: [{
project: cloneProject(project),
require: [ 'ace/snippets/' + modeName ]
}],
filter: getWriteFilters(options, "mode"),
dest: targetDir + "/snippets/" + modeName + ".js"
});
}

var textModules = {}
Expand All @@ -494,7 +494,7 @@ var detectTextModules = function(input, source) {
input = input.toString();

var module = source.isLocation ? source.path : source;

input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
if (/\.css$/.test(module)) {
// remove unnecessary whitespace from css
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/snippets/abap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./abap.snippets");

exports.scope = "abap";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/actionscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./actionscript.snippets");
exports.scope = "actionscript";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/ada.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./ada.snippets");
exports.scope = "ada";

});
Empty file added lib/ace/snippets/ada.snippets
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/asciidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./asciidoc.snippets");

exports.scope = "asciidoc";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/assembly_x86.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./assembly_x86.snippets");
exports.scope = "assembly_x86";

});
Empty file.
7 changes: 7 additions & 0 deletions lib/ace/snippets/autohotkey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./autohotkey.snippets");
exports.scope = "autohotkey";

});
Empty file.
7 changes: 7 additions & 0 deletions lib/ace/snippets/batchfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./batchfile.snippets");
exports.scope = "batchfile";

});
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/c9search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./c9search.snippets");

exports.scope = "c9search";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/c_cpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./c_cpp.snippets");

exports.scope = "c_cpp";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/clojure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./clojure.snippets");

exports.scope = "clojure";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/cobol.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./cobol.snippets");
exports.scope = "cobol";

});
Empty file added lib/ace/snippets/cobol.snippets
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/coffee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./coffee.snippets");

exports.scope = "coffee";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/coldfusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./coldfusion.snippets");

exports.scope = "coldfusion";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/csharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./csharp.snippets");

exports.scope = "csharp";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./css.snippets");

exports.scope = "css";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/curly.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./curly.snippets");

exports.scope = "curly";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/d.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./d.snippets");
exports.scope = "d";

});
Empty file added lib/ace/snippets/d.snippets
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./dart.snippets");

exports.scope = "dart";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./diff.snippets");

exports.scope = "diff";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/django.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./django.snippets");

exports.scope = "django";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./dot.snippets");

exports.scope = "dot";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/ejs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./ejs.snippets");
exports.scope = "ejs";

});
Empty file added lib/ace/snippets/ejs.snippets
Empty file.
7 changes: 7 additions & 0 deletions lib/ace/snippets/erlang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./erlang.snippets");
exports.scope = "erlang";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/forth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./forth.snippets");
exports.scope = "forth";

});
Empty file added lib/ace/snippets/forth.snippets
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/ftl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./ftl.snippets");

exports.scope = "ftl";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./glsl.snippets");

exports.scope = "glsl";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/golang.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./golang.snippets");

exports.scope = "golang";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/groovy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./groovy.snippets");

exports.scope = "groovy";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/haml.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./haml.snippets");

exports.scope = "haml";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/haskell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./haskell.snippets");
exports.scope = "haskell";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/haxe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./haxe.snippets");

exports.scope = "haxe";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./html.snippets");

exports.scope = "html";

});
7 changes: 7 additions & 0 deletions lib/ace/snippets/html_ruby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./html_ruby.snippets");
exports.scope = "html_ruby";

});
Empty file.
7 changes: 7 additions & 0 deletions lib/ace/snippets/ini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./ini.snippets");
exports.scope = "ini";

});
Empty file added lib/ace/snippets/ini.snippets
Empty file.
2 changes: 1 addition & 1 deletion lib/ace/snippets/jade.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./jade.snippets");

exports.scope = "jade";

});
2 changes: 1 addition & 1 deletion lib/ace/snippets/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ define(function(require, exports, module) {
"use strict";

exports.snippetText = require("../requirejs/text!./java.snippets");

exports.scope = "java";

});
Loading

0 comments on commit c223f59

Please sign in to comment.