diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 73abf1c1..cf3a4148 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -155,7 +155,7 @@ function ace() { source: ACE_HOME + "/ChangeLog.txt", dest: BUILD_DIR + "/ChangeLog.txt" }); - + return project; } @@ -211,7 +211,7 @@ function demo(project) { }); var demo = copy.createDataObject(); - + project.assumeAllFilesLoaded(); copy({ source: [{ @@ -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); @@ -334,7 +334,7 @@ var buildAce = function(options) { filter: [ copy.filter.moduleDefines ], dest: ace }); - + if (options.coreOnly) return project; @@ -349,6 +349,7 @@ var buildAce = function(options) { project.assumeAllFilesLoaded(); options.modes.forEach(function(mode) { console.log("mode " + mode); + addSnippetFile(mode, project, targetDir, options); copy({ source: [{ project: cloneProject(project), @@ -441,7 +442,7 @@ var buildAce = function(options) { dest: BUILD_DIR + '/ace-min.js' }); } - + return project; }; @@ -460,6 +461,30 @@ 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/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 = {} var detectTextModules = function(input, source) { if (!source) @@ -469,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 diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js index a2a7fbc8..253c0dda 100644 --- a/demo/kitchen-sink/demo.js +++ b/demo/kitchen-sink/demo.js @@ -155,7 +155,7 @@ env.editor.commands.addCommands([{ bindKey: "ctrl+enter", exec: function(editor) { try { - var r = eval(editor.getCopyText()||editor.getValue()); + var r = window.eval(editor.getCopyText()||editor.getValue()); } catch(e) { r = e; } @@ -196,7 +196,7 @@ commands.addCommand({ exec: function() {alert("Fake Save File");} }); -var keybindings = { +var keybindings = { ace: null, // Null = use "default" keymapping vim: require("ace/keyboard/vim").handler, emacs: "ace/keyboard/emacs", @@ -431,7 +431,7 @@ bindDropdown("split", function(value) { sp.setSplits(1); } else { var newEditor = (sp.getSplits() == 1); - sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE); + sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE); sp.setSplits(2); if (newEditor) { @@ -517,17 +517,9 @@ net.loadScript("https://rawgithub.com/nightwing/emmet-core/master/emmet.js", fun }) -require("ace/placeholder").PlaceHolder; +// require("ace/placeholder").PlaceHolder; -var snippetManager = require("ace/snippets").snippetManager -var jsSnippets = require("ace/snippets/javascript"); -window.snippetManager = snippetManager -saveSnippets() - -function saveSnippets() { - jsSnippets.snippets = snippetManager.parseSnippetFile(jsSnippets.snippetText); - snippetManager.register(jsSnippets.snippets, "javascript") -} +var snippetManager = require("ace/snippets").snippetManager; env.editSnippets = function() { var sp = env.split; @@ -538,25 +530,32 @@ env.editSnippets = function() { sp.setSplits(1); sp.setSplits(2); sp.setOrientation(sp.BESIDE); - var editor = sp.$editors[1] - if (!env.snippetSession) { - var file = jsSnippets.snippetText; - env.snippetSession = doclist.initDoc(file, "", {}); - env.snippetSession.setMode("ace/mode/tmsnippet"); - env.snippetSession.setUseSoftTabs(false); + var editor = sp.$editors[1]; + var id = sp.$editors[0].session.$mode.$id || ""; + var m = snippetManager.files[id]; + if (!doclist["snippets/" + id]) { + var text = m.snippetText; + var s = doclist.initDoc(text, "", {}); + s.setMode("ace/mode/snippets"); + doclist["snippets/" + id] = s } editor.on("blur", function() { - jsSnippets.snippetText = editor.getValue(); - saveSnippets(); + m.snippetText = editor.getValue(); + snippetManager.unregister(m.snippets); + m.snippets = snippetManager.parseSnippetFile(m.snippetText); + snippetManager.register(m.snippets); }) - editor.setSession(env.snippetSession, 1); + sp.$editors[0].once("changeMode", function() { + sp.setSplits(1); + }) + editor.setSession(doclist["snippets/" + id], 1); editor.focus(); } -ace.commands.bindKey("Tab", function(editor) { - var success = snippetManager.expandWithTab(editor); - if (!success) - editor.execCommand("indent"); +require("ace/ext/language_tools"); +env.editor.setOptions({ + enableBasicAutocompletion: true, + enableSnippets: true }) }); diff --git a/lib/ace/autocomplete.js b/lib/ace/autocomplete.js new file mode 100644 index 00000000..fef14ff4 --- /dev/null +++ b/lib/ace/autocomplete.js @@ -0,0 +1,267 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var AcePopup = require("./autocomplete/popup").AcePopup; +var util = require("./autocomplete/util"); +var event = require("./lib/event"); +var lang = require("./lib/lang"); + +var Autocomplete = function() { + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys(this.commands); + + this.blurListener = this.blurListener.bind(this); + this.changeListener = this.changeListener.bind(this); + this.mousedownListener = this.mousedownListener.bind(this); + this.mousewheelListener = this.mousewheelListener.bind(this); + + this.changeTimer = lang.delayedCall(function() { + this.updateCompletions(true); + }.bind(this)) +}; + +(function() { + this.$init = function() { + this.popup = new AcePopup(document.body || document.documentElement); + this.popup.on("click", function(e) { + this.insertMatch(); + e.stop(); + }.bind(this)); + }; + + this.openPopup = function(editor, keepPopupPosition) { + if (!this.popup) + this.$init(); + + this.popup.setData(this.completions.filtered); + + var renderer = editor.renderer; + if (!keepPopupPosition) { + var lineHeight = renderer.layerConfig.lineHeight; + var pos = renderer.$cursorLayer.getPixelPosition(null, true); + var rect = editor.container.getBoundingClientRect(); + pos.top += rect.top - renderer.layerConfig.offset; + pos.left += rect.left; + pos.left += renderer.$gutterLayer.gutterWidth; + + this.popup.show(pos, lineHeight); + } + renderer.updateText(); + }; + + this.detach = function() { + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.removeEventListener("changeSelection", this.changeListener); + this.editor.removeEventListener("blur", this.changeListener); + this.editor.removeEventListener("mousedown", this.changeListener); + this.changeTimer.cancel(); + + if (this.popup) + this.popup.hide(); + + this.activated = false; + }; + + this.changeListener = function(e) { + if (this.activated) + this.changeTimer.schedule(); + else + this.detach(); + }; + + this.blurListener = function() { + if (document.activeElement != this.editor.textInput.getElement()) + this.detach(); + }; + + this.mousedownListener = function(e) { + this.detach(); + }; + + this.mousewheelListener = function(e) { + this.detach(); + }; + + this.goTo = function(where) { + var row = this.popup.getRow(); + var max = this.popup.session.getLength() - 1; + + switch(where) { + case "up": row = row <= 0 ? max : row - 1; break; + case "down": row = row >= max ? 0 : row + 1; break; + case "start": row = 0; break; + case "end": row = max; break; + } + + this.popup.setRow(row); + }; + + this.insertMatch = function(data) { + this.detach(); + if (!data) + data = this.popup.getData(this.popup.getRow()); + if (!data) + return false; + if (data.completer && data.completer.insertMatch) { + data.completer.insertMatch(this.editor); + } else { + if (data.value) + data = data.value; + if (this.completions.filterText) + this.editor.removeWordLeft(); + this.editor.insert(data); + } + }; + + this.commands = { + "Up": function(editor) { editor.completer.goTo("up"); }, + "Down": function(editor) { editor.completer.goTo("down"); }, + "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, + "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, + + "Esc": function(editor) { editor.completer.detach(); }, + "Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, + "Return": function(editor) { editor.completer.insertMatch(); }, + "Shift-Return": function(editor) { editor.completer.insertMatch(true); }, + "Tab": function(editor) { editor.completer.insertMatch(); }, + + "PageUp": function(editor) { editor.completer.popup.gotoPageDown(); }, + "PageDown": function(editor) { editor.completer.popup.gotoPageUp(); } + }; + + this.gatherCompletions = function(editor, callback) { + var session = editor.getSession(); + var pos = editor.getCursorPosition(); + + var line = session.getLine(pos.row); + var prefix = util.retrievePrecedingIdentifier(line, pos.column); + + var matches = []; + util.parForEach(editor.completers, function(completer, next) { + completer.getCompletions(session, pos, prefix, function(err, results) { + if (!err) + matches = matches.concat(results); + next(); + }); + }, function() { + matches.sort(function(a, b) { + return b.score - a.score; + }); + callback(null, { + prefix: prefix, + matches: matches + }); + }); + return true; + }; + + this.showPopup = function(editor) { + if (this.editor) + this.detach(); + + this.activated = true; + + this.editor = editor; + if (editor.completer != this) { + if (editor.completer) + editor.completer.detach(); + editor.completer = this; + } + + editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + editor.on("changeSelection", this.changeListener); + editor.on("blur", this.blurListener); + editor.on("mousedown", this.mousedownListener); + this.updateCompletions(); + } + + this.updateCompletions = function(keepPopupPosition) { + this.gatherCompletions(this.editor, function(err, results) { + var matches = results && results.matches; + if (!matches || !matches.length) + return this.detach(); + // TODO reenable this when we have proper change tracking + // if (matches.length == 1) + // return this.insertMatch(matches[0]); + + this.completions = new FilteredList(matches); + this.completions.setFilter(results.prefix); + this.openPopup(this.editor, keepPopupPosition); + this.popup.setHighlight(results.prefix); + }.bind(this)); + }; + + this.cancelContextMenu = function() { + var stop = function(e) { + this.editor.off("nativecontextmenu", stop); + if (e && e.domEvent) + event.stopEvent(e.domEvent); + }.bind(this); + setTimeout(stop, 10); + this.editor.on("nativecontextmenu", stop); + }; + +}).call(Autocomplete.prototype); + +Autocomplete.startCommand = { + name: "startAutocomplete", + exec: function(editor) { + if (!editor.completer) + editor.completer = new Autocomplete(); + editor.completer.showPopup(editor); + // needed for firefox on mac + editor.completer.cancelContextMenu(); + }, + bindKey: "Ctrl-Space|Shift-Space|Alt-Space" +}; +Autocomplete.addTo = function(editor) { + editor.commands.addCommand(Autocomplete.startCommand); +}; + +var FilteredList = function(array, mutateData) { + this.all = array; + this.filtered = array.concat(); + this.filterText = ""; +}; +(function(){ + this.setFilter = function(str) { + this.filterText = str; + }; + +}).call(FilteredList.prototype); + +exports.Autocomplete = Autocomplete; +exports.FilteredList = FilteredList; + +}); \ No newline at end of file diff --git a/lib/ace/autocomplete/popup.js b/lib/ace/autocomplete/popup.js new file mode 100644 index 00000000..85a5d8b7 --- /dev/null +++ b/lib/ace/autocomplete/popup.js @@ -0,0 +1,261 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +var EditSession = require("../edit_session").EditSession; +var Renderer = require("../virtual_renderer").VirtualRenderer; +var Editor = require("../editor").Editor; +var Range = require("../range").Range; +var event = require("../lib/event"); +var lang = require("../lib/lang"); +var dom = require("../lib/dom"); + +var $singleLineEditor = function(el) { + var renderer = new Renderer(el); + + renderer.maxLines = 4; + renderer.$computeLayerConfigWithScroll = renderer.$computeLayerConfig; + renderer.scrollBar.orginalWidth = renderer.scrollBar.getWidth(); + renderer.$computeLayerConfig = function() { + var height = this.session.getScreenLength() * this.lineHeight; + var maxHeight = this.maxLines * this.lineHeight; + var desiredHeight = Math.max(this.lineHeight, Math.min(maxHeight, height)); + var vScroll = height > maxHeight; + if (desiredHeight != this.desiredHeight || vScroll != this.$vScroll) { + if (vScroll != this.$vScroll) { + if (vScroll) { + this.scrollBar.element.style.display = ""; + this.scrollBar.width = this.scrollBar.orginalWidth; + + height = maxHeight; + this.scrollTop = height - this.maxLines * this.lineHeight; + } else { + this.scrollBar.element.style.display = "none"; + this.scrollBar.width = 0; + } + + this.$size.height = 0; + this.$size.width = 0; + + this.$vScroll = vScroll; + } + + this.container.style.height = desiredHeight + "px"; + this.onResize(); + this.$loop.changes = 0; + this.desiredHeight = desiredHeight; + this.scroller.style.overflowX = "hidden"; + } + return renderer.$computeLayerConfigWithScroll(); + }; + + var editor = new Editor(renderer); + + editor.setHighlightActiveLine(false); + editor.setShowPrintMargin(false); + editor.renderer.setShowGutter(false); + editor.renderer.setHighlightGutterLine(false); + + editor.$mouseHandler.$focusWaitTimout = 0; + + return editor; +}; + +var AcePopup = function(parentNode) { + var el = dom.createElement("div"); + var popup = new $singleLineEditor(el); + + if (parentNode) + parentNode.appendChild(el); + el.style.display = "none"; + popup.renderer.content.style.cursor = "default"; + popup.renderer.setStyle("ace_autocomplete"); + + var noop = function(){}; + + popup.focus = noop; + popup.$isFocused = true; + + popup.renderer.$cursorLayer.restartTimer = noop; + popup.renderer.$cursorLayer.element.style.opacity = 0; + + popup.renderer.maxLines = 8; + popup.renderer.$keepTextAreaAtCursor = false; + + popup.setHighlightActiveLine(true); + // set default highlight color + popup.session.highlight(""); + popup.session.$searchHighlight.clazz = "ace_highlight-marker"; + + popup.on("mousedown", function(e) { + var pos = e.getDocumentPosition(); + popup.moveCursorToPosition(pos); + popup.selection.clearSelection(); + e.stop(); + }); + + var hoverMarker = new Range(-1,0,-1,Infinity); + hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); + popup.on("mousemove", function(e) { + //if (popup.lastOpened) + var row = e.getDocumentPosition().row; + hoverMarker.start.row = hoverMarker.end.row = row; + popup.session._emit("changeBackMarker"); + }); + var hideHoverMarker = function() { + hoverMarker.start.row = hoverMarker.end.row = -1; + popup.session._emit("changeBackMarker"); + }; + event.addListener(popup.container, "mouseout", hideHoverMarker); + popup.on("hide", hideHoverMarker); + popup.on("changeSelection", hideHoverMarker); + popup.on("mousewheel", function(e) { + setTimeout(function() { + popup._signal("mousemove", e); + }); + }); + + popup.session.doc.getLength = function() { + return popup.data.length; + }; + popup.session.doc.getLine = function(i) { + var data = popup.data[i]; + if (typeof data == "string") + return data; + return (data && data.value) || ""; + }; + + var bgTokenizer = popup.session.bgTokenizer; + bgTokenizer.$tokenizeRow = function(i) { + var data = popup.data[i]; + var tokens = []; + if (!data) + return tokens; + if (typeof data == "string") + data = {value: data}; + + tokens.push({type: data.className || "", value: data.value}); + if (data.meta) { + var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; + if (data.meta.length + data.value.length < maxW - 2) + tokens.push({type: "rightAlignedText", value: data.meta}); + } + return tokens; + }; + bgTokenizer.$updateOnChange = noop; + + popup.session.$computeWidth = function() { + return this.screenWidth = 0; + } + + // public + popup.data = []; + popup.setData = function(list) { + popup.data = list || []; + popup.setValue(lang.stringRepeat("\n", list.length), -1); + }; + popup.getData = function(row) { + return popup.data[row]; + }; + + popup.getRow = function() { + var line = this.getCursorPosition().row; + if (line == 0 && !this.getHighlightActiveLine()) + line = -1; + return line; + }; + popup.setRow = function(line) { + popup.setHighlightActiveLine(line != -1); + popup.selection.clearSelection(); + popup.moveCursorTo(line, 0 || 0); + }; + + popup.setHighlight = function(re) { + popup.session.highlight(re); + popup.session._emit("changeFrontMarker"); + }; + + popup.hide = function() { + this.container.style.display = "none"; + this._signal("hide"); + }; + popup.show = function(pos, lineHeight) { + var el = this.container; + if (pos.top > window.innerHeight / 2 + lineHeight) { + el.style.top = ""; + el.style.bottom = window.innerHeight - pos.top + "px"; + } else { + pos.top += lineHeight; + el.style.top = pos.top + "px"; + el.style.bottom = ""; + } + + el.style.left = pos.left + "px"; + el.style.display = ""; + + this._signal("show"); + }; + + return popup; +}; + +dom.importCssString("\ +.ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {\ + background-color: #abbffe;\ +}\ +.ace_autocomplete.ace-tm .ace_line-hover {\ + border: 1px solid #abbffe;\ + position: absolute;\ + background: rgba(233,233,253,0.4);\ + z-index: 2;\ + margin-top: -1px;\ +}\ +.ace_rightAlignedText {\ + color: gray;\ + display: inline-block;\ + position: absolute;\ + right: 4px;\ + text-align: right;\ + z-index: -1;\ +}\ +.ace_autocomplete {\ + width: 200px;\ + z-index: 200000;\ + background: #f8f8f8;\ + border: 1px lightgray solid;\ + position: fixed;\ + box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ +}"); + +exports.AcePopup = AcePopup; + +}); \ No newline at end of file diff --git a/lib/ace/autocomplete/text_completer.js b/lib/ace/autocomplete/text_completer.js new file mode 100644 index 00000000..2808ff6f --- /dev/null +++ b/lib/ace/autocomplete/text_completer.js @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + var Range = require("ace/range").Range; + + var splitRegex = /[^a-zA-Z_0-9\$\-]+/; + + function getWordIndex(doc, pos) { + var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); + return textBefore.split(splitRegex).length - 1; + } + + // NOTE: Naive implementation O(n), can be O(log n) with binary search + function filterPrefix(prefix, words) { + var results = []; + for (var i = 0; i < words.length; i++) { + if (words[i].lastIndexOf(prefix, 0) === 0) { + results.push(words[i]); + } + } + return results; + } + + /** + * Does a distance analysis of the word `prefix` at position `pos` in `doc`. + * @return Map + */ + function wordDistance(doc, pos) { + var prefixPos = getWordIndex(doc, pos); + var words = doc.getValue().split(splitRegex); + var wordScores = Object.create(null); + + var currentWord = words[prefixPos]; + + words.forEach(function(word, idx) { + if (!word || word === currentWord) return; + + var distance = Math.abs(prefixPos - idx); + var score = words.length - distance; + if (wordScores[word]) { + wordScores[word] = Math.max(score, wordScores[word]); + } else { + wordScores[word] = score; + } + }); + return wordScores; + } + + exports.getCompletions = function(session, pos, prefix, callback) { + var wordScore = wordDistance(session, pos, prefix); + var wordList = filterPrefix(prefix, Object.keys(wordScore)); + callback(null, wordList.map(function(word) { + return { + name: word, + value: word, + score: wordScore[word], + meta: "local" + }; + })); + }; +}); \ No newline at end of file diff --git a/lib/ace/autocomplete/util.js b/lib/ace/autocomplete/util.js new file mode 100644 index 00000000..ae9ece5d --- /dev/null +++ b/lib/ace/autocomplete/util.js @@ -0,0 +1,74 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +exports.parForEach = function(array, fn, callback) { + var completed = 0; + var arLength = array.length; + if (arLength === 0) + callback(); + for (var i = 0; i < arLength; i++) { + fn(array[i], function(result, err) { + completed++; + if (completed === arLength) + callback(result, err); + }); + } +} + +var ID_REGEX = /[a-zA-Z_0-9\$]/; + +exports.retrievePrecedingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos-1; i >= 0; i--) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf.reverse().join(""); +} + +exports.retrieveFollowingIdentifier = function(text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos; i < text.length; i++) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf; +} + +}); diff --git a/lib/ace/commands/command_manager.js b/lib/ace/commands/command_manager.js index b3e0fc6d..e8a581ad 100644 --- a/lib/ace/commands/command_manager.js +++ b/lib/ace/commands/command_manager.js @@ -16,9 +16,6 @@ var EventEmitter = require("../lib/event_emitter").EventEmitter; * @param {String} platform Identifier for the platform; must be either `'mac'` or `'win'` * @param {Array} commands A list of commands * - * - * - * **/ var CommandManager = function(platform, commands) { diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 4f32b905..8ebc1616 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -181,7 +181,7 @@ white-space: nowrap; } -.ace_marker-layer .ace_step { +.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { position: absolute; z-index: 3; } @@ -386,3 +386,16 @@ .ace_italic { font-style: italic; } + + +.ace_error-marker { + background-color: rgba(255, 0, 0,0.2); + position: absolute; + z-index: 9; +} + +.ace_highlight-marker { + background-color: rgba(255, 255, 0,0.2); + position: absolute; + z-index: 8; +} diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index c8cb43ff..4f9ace1f 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -461,7 +461,8 @@ var EditSession = function(text, mode) { * @returns {Boolean} **/ this.getUseSoftTabs = function() { - return this.$useSoftTabs; + // todo might need more general way for changing settings from mode, but this is ok for now + return this.$useSoftTabs && !this.$mode.$indentWithTabs; }; /** * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. diff --git a/lib/ace/edit_session/folding.js b/lib/ace/edit_session/folding.js index e85d4f0c..b36857c6 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -639,8 +639,8 @@ function Folding() { if (range && range.end.row <= endRow) try { var fold = this.addFold("...", range); fold.collapseChildren = depth; + row = range.end.row; } catch(e) {} - row = range.end.row; } }; diff --git a/lib/ace/ext/language_tools.js b/lib/ace/ext/language_tools.js new file mode 100644 index 00000000..7133d740 --- /dev/null +++ b/lib/ace/ext/language_tools.js @@ -0,0 +1,115 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +var snippetManager = require("../snippets").snippetManager; +var Autocomplete = require("../autocomplete").Autocomplete; +var config = require("../config"); + +var textCompleter = require("../autocomplete/text_completer"); +var keyWordCompleter = { + getCompletions: function(session, pos, prefix, callback) { + var keywords = session.$mode.$keywordList || []; + keywords = keywords.filter(function(w) { + return w.lastIndexOf(prefix, 0) == 0; + }); + callback(null, keywords.map(function(word) { + return { + name: word, + value: word, + score: 0, + meta: "keyword" + }; + })); + } +}; + +var completers = [textCompleter, keyWordCompleter]; // todo add snippets completer +exports.addCompleter = function(completer) { + completers.push(completer); +}; + +var expandSnippet = { + name: "expandSnippet", + exec: function(editor) { + var success = snippetManager.expandWithTab(editor); + if (!success) + editor.execCommand("indent"); + }, + bindKey: "tab" +} + +var onChangeMode = function(e, editor) { + var mode = editor.session.$mode; + var id = mode.$id + if (!snippetManager.files) snippetManager.files = {}; + if (id && !snippetManager.files[id]) { + var snippetFilePath = id.replace("mode", "snippets"); + config.loadModule(snippetFilePath, function(m) { + if (m) { + snippetManager.files[id] = m; + m.snippets = snippetManager.parseSnippetFile(m.snippetText); + snippetManager.register(m.snippets, m.scope); + } + }); + } +}; + +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + enableBasicAutocompletion: { + set: function(val) { + if (val) { + this.completers = completers + this.commands.addCommand(Autocomplete.startCommand); + } else { + this.commands.removeCommand(Autocomplete.startCommand); + } + }, + value: false + }, + enableSnippets: { + set: function(val) { + if (val) { + this.commands.addCommand(expandSnippet); + this.on("changeMode", onChangeMode); + onChangeMode(null, this) + } else { + this.commands.removeCommand(expandSnippet); + this.off("changeMode", onChangeMode); + } + }, + value: false + } +}); + +}); \ No newline at end of file diff --git a/lib/ace/ext/split.js b/lib/ace/ext/split.js new file mode 100644 index 00000000..8316562f --- /dev/null +++ b/lib/ace/ext/split.js @@ -0,0 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2010, Ajax.org B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +/** + * this is experimental, and subject to change, use at your own risk! + */ +module.exports = require("../split"); + +}); + diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index e7fbab5b..1309c295 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -40,8 +40,8 @@ var BROKEN_SETDATA = useragent.isChrome < 18; var TextInput = function(parentNode, host) { var text = dom.createElement("textarea"); text.className = "ace_text-input"; - /*/ debug - text.style.cssText = "opacity:1;background:rgba(0, 250, 0, 0.3);outline:rgba(0, 250, 0, 0.8) solid 1px;outline-offset:3px;width:5em;z-index:500"; + // debug + text.style.cssText = "opacity:1;background:rgba(0, 250, 0, 0.3);outline:rgba(0, 250, 0, 0.8) solid 1px;outline-offset:3px;width:5em;z-pindex:500"; /**/ if (useragent.isTouchPad) text.setAttribute("x-palm-disable-auto-cap", true); @@ -436,10 +436,10 @@ var TextInput = function(parentNode, host) { tempStyle = text.style.cssText; text.style.cssText = "z-index:100000;" + (useragent.isIE ? "opacity:0.1;" : ""); - // text.style.cssText += "background:rgba(250, 0, 0, 0.3); opacity:1;"; + text.style.cssText += "background:rgba(250, 0, 0, 0.3); opacity:1;"; resetSelection(host.selection.isEmpty()); - host._emit("nativecontextmenu", {target: host}); + host._emit("nativecontextmenu", {target: host, domEvent: e}); var rect = host.container.getBoundingClientRect(); var style = dom.computedStyle(host.container); var top = rect.top + (parseInt(style.borderTopWidth) || 0); @@ -477,7 +477,7 @@ var TextInput = function(parentNode, host) { } // firefox fires contextmenu event after opening it - if (!useragent.isGecko) { + if (!useragent.isGecko || useragent.isMac) { event.addListener(text, "contextmenu", function(e) { host.textInput.onContextMenu(e); onContextMenuClose(); diff --git a/lib/ace/mode/abap.js b/lib/ace/mode/abap.js index b2ba82c4..fbd8066a 100644 --- a/lib/ace/mode/abap.js +++ b/lib/ace/mode/abap.js @@ -39,7 +39,9 @@ var TextMode = require("./text").Mode; var oop = require("../lib/oop"); function Mode() { - this.$tokenizer = new Tokenizer(new Rules().getRules()); + var highlighter = new Rules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = new Rules(highlighter.$keywordList); this.foldingRules = new FoldMode(); } diff --git a/lib/ace/mode/c_cpp.js b/lib/ace/mode/c_cpp.js index c388dc0f..6b6f8c09 100644 --- a/lib/ace/mode/c_cpp.js +++ b/lib/ace/mode/c_cpp.js @@ -41,9 +41,13 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new c_cppHighlightRules().getRules()); + var highlighter = new c_cppHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); + this.$keywordList = highlighter.$keywordList; + this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/clojure.js b/lib/ace/mode/clojure.js index d1494e02..df67dc06 100644 --- a/lib/ace/mode/clojure.js +++ b/lib/ace/mode/clojure.js @@ -39,7 +39,9 @@ var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensO var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new ClojureHighlightRules().getRules()); + var highlighter = new ClojureHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingParensOutdent(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/coffee.js b/lib/ace/mode/coffee.js index b2bb55ad..4a6d2201 100644 --- a/lib/ace/mode/coffee.js +++ b/lib/ace/mode/coffee.js @@ -41,8 +41,10 @@ var WorkerClient = require("../worker/worker_client").WorkerClient; var oop = require("../lib/oop"); function Mode() { - this.$tokenizer = new Tokenizer(new Rules().getRules()); + var highlighter = new Rules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new Outdent(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new FoldMode(); } diff --git a/lib/ace/mode/csharp.js b/lib/ace/mode/csharp.js index 2e536294..66644b45 100644 --- a/lib/ace/mode/csharp.js +++ b/lib/ace/mode/csharp.js @@ -10,9 +10,11 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new CSharpHighlightRules().getRules()); + var highlighter = new CSharpHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/css.js b/lib/ace/mode/css.js index 2c5807c7..fcaa298c 100644 --- a/lib/ace/mode/css.js +++ b/lib/ace/mode/css.js @@ -41,9 +41,11 @@ var CssBehaviour = require("./behaviour/css").CssBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules()); + var highlighter = new CssHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CssBehaviour(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/dart.js b/lib/ace/mode/dart.js index 114c79ab..cab31e08 100644 --- a/lib/ace/mode/dart.js +++ b/lib/ace/mode/dart.js @@ -52,6 +52,7 @@ var Mode = function() { this.foldingRules = new CStyleFoldMode(); this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, CMode); diff --git a/lib/ace/mode/glsl.js b/lib/ace/mode/glsl.js index 641f5ebc..ef2a2b44 100644 --- a/lib/ace/mode/glsl.js +++ b/lib/ace/mode/glsl.js @@ -41,9 +41,12 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new glslHighlightRules().getRules()); + var highlighter = new glslHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, CMode); diff --git a/lib/ace/mode/golang.js b/lib/ace/mode/golang.js index f00ce9c7..91b3e085 100644 --- a/lib/ace/mode/golang.js +++ b/lib/ace/mode/golang.js @@ -9,7 +9,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new GolangHighlightRules().getRules()); + var highlighter = new GolangHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingBraceOutdent(); this.foldingRules = new CStyleFoldMode(); }; diff --git a/lib/ace/mode/groovy.js b/lib/ace/mode/groovy.js index fad038eb..65d87cd4 100644 --- a/lib/ace/mode/groovy.js +++ b/lib/ace/mode/groovy.js @@ -8,7 +8,9 @@ var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRu var Mode = function() { JavaScriptMode.call(this); - this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules()); + var highlighter = new GroovyHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, JavaScriptMode); diff --git a/lib/ace/mode/haxe.js b/lib/ace/mode/haxe.js index edbfef6b..3933a769 100644 --- a/lib/ace/mode/haxe.js +++ b/lib/ace/mode/haxe.js @@ -10,9 +10,12 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new HaxeHighlightRules().getRules()); + var highlighter = new HaxeHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/java.js b/lib/ace/mode/java.js index 1b7045ea..f132130b 100644 --- a/lib/ace/mode/java.js +++ b/lib/ace/mode/java.js @@ -8,8 +8,10 @@ var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; var Mode = function() { JavaScriptMode.call(this); + var highlighter = new JavaHighlightRules(); - this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules()); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, JavaScriptMode); diff --git a/lib/ace/mode/javascript.js b/lib/ace/mode/javascript.js index a3e45bcc..00d8af1a 100644 --- a/lib/ace/mode/javascript.js +++ b/lib/ace/mode/javascript.js @@ -42,9 +42,12 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules()); + var highlighter = new JavaScriptHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 638ef6b3..3984f2c3 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -168,7 +168,7 @@ var JavaScriptHighlightRules = function() { next : "start" }, { token : ["punctuation.operator", "support.function"], - regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ }, { token : ["punctuation.operator", "support.function.dom"], regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ diff --git a/lib/ace/mode/liquid.js b/lib/ace/mode/liquid.js index 8555e6c5..247c02a1 100644 --- a/lib/ace/mode/liquid.js +++ b/lib/ace/mode/liquid.js @@ -38,7 +38,10 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new LiquidHighlightRules().getRules()); + var highlighter = new LiquidHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingBraceOutdent(); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/lisp.js b/lib/ace/mode/lisp.js index 5bae6689..46427d60 100644 --- a/lib/ace/mode/lisp.js +++ b/lib/ace/mode/lisp.js @@ -45,6 +45,7 @@ var Mode = function() { var highlighter = new LispHighlightRules(); this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/lua.js b/lib/ace/mode/lua.js index 2ef9031a..58a3c822 100644 --- a/lib/ace/mode/lua.js +++ b/lib/ace/mode/lua.js @@ -40,8 +40,11 @@ var Range = require("../range").Range; var WorkerClient = require("../worker/worker_client").WorkerClient; var Mode = function() { - this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules()); + var highlighter = new LuaHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.foldingRules = new LuaFoldMode(); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/makefile.js b/lib/ace/mode/makefile.js index 7f8f726b..e51a22bb 100644 --- a/lib/ace/mode/makefile.js +++ b/lib/ace/mode/makefile.js @@ -51,12 +51,15 @@ var Mode = function() { this.foldingRules = new FoldMode(); this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "#"; + this.lineCommentStart = "#"; + this.$indentWithTabs = true; + }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/ocaml.js b/lib/ace/mode/ocaml.js index 6367b937..9aa6643d 100644 --- a/lib/ace/mode/ocaml.js +++ b/lib/ace/mode/ocaml.js @@ -39,8 +39,11 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new OcamlHighlightRules().getRules()); + var highlighter = new OcamlHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/perl.js b/lib/ace/mode/perl.js index ff8eaa18..46d20065 100644 --- a/lib/ace/mode/perl.js +++ b/lib/ace/mode/perl.js @@ -40,9 +40,12 @@ var Range = require("../range").Range; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new PerlHighlightRules().getRules()); + var highlighter = new PerlHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"}); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/pgsql.js b/lib/ace/mode/pgsql.js index 29c30311..2398ea83 100755 --- a/lib/ace/mode/pgsql.js +++ b/lib/ace/mode/pgsql.js @@ -37,11 +37,14 @@ var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new PgsqlHighlightRules().getRules()); + var highlighter = new PgsqlHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); -(function() { +(function() { this.lineCommentStart = "--"; this.blockComment = {start: "/*", end: "*/"}; diff --git a/lib/ace/mode/powershell.js b/lib/ace/mode/powershell.js index b0c12eb7..f3bfcdcc 100644 --- a/lib/ace/mode/powershell.js +++ b/lib/ace/mode/powershell.js @@ -10,7 +10,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new PowershellHighlightRules().getRules()); + var highlighter = new PowershellHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode({start: "^\\s*(<#)", end: "^[#\\s]>\\s*$"}); diff --git a/lib/ace/mode/python.js b/lib/ace/mode/python.js index 5a38f2c4..7adaf918 100644 --- a/lib/ace/mode/python.js +++ b/lib/ace/mode/python.js @@ -39,7 +39,9 @@ var PythonFoldMode = require("./folding/pythonic").FoldMode; var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules()); + var highlighter = new PythonHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.foldingRules = new PythonFoldMode("\\:"); }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/ruby.js b/lib/ace/mode/ruby.js index 073fa070..ca832137 100644 --- a/lib/ace/mode/ruby.js +++ b/lib/ace/mode/ruby.js @@ -40,7 +40,10 @@ var Range = require("../range").Range; var FoldMode = require("./folding/coffee").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new RubyHighlightRules().getRules()); + var highlighter = new RubyHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingBraceOutdent(); this.foldingRules = new FoldMode(); }; diff --git a/lib/ace/mode/scad.js b/lib/ace/mode/scad.js index c5c3e04b..6bd094bc 100644 --- a/lib/ace/mode/scad.js +++ b/lib/ace/mode/scad.js @@ -41,7 +41,10 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.$tokenizer = new Tokenizer(new scadHighlightRules().getRules()); + var highlighter = new scadHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); diff --git a/lib/ace/mode/scala.js b/lib/ace/mode/scala.js index 407d41cc..97e891fd 100644 --- a/lib/ace/mode/scala.js +++ b/lib/ace/mode/scala.js @@ -9,7 +9,9 @@ var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules var Mode = function() { JavaScriptMode.call(this); - this.$tokenizer = new Tokenizer(new ScalaHighlightRules().getRules()); + var highlighter = new ScalaHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, JavaScriptMode); diff --git a/lib/ace/mode/sh.js b/lib/ace/mode/sh.js index d97b336a..84496fb3 100644 --- a/lib/ace/mode/sh.js +++ b/lib/ace/mode/sh.js @@ -38,7 +38,10 @@ var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new ShHighlightRules().getRules()); + var highlighter = new ShHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/snippets.js b/lib/ace/mode/snippets.js index d3e51863..ed394c8a 100644 --- a/lib/ace/mode/snippets.js +++ b/lib/ace/mode/snippets.js @@ -105,9 +105,7 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; + this.$indentWithTabs = true; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/sql.js b/lib/ace/mode/sql.js index 6d5c8372..6b4d9c6e 100644 --- a/lib/ace/mode/sql.js +++ b/lib/ace/mode/sql.js @@ -38,7 +38,10 @@ var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; var Range = require("../range").Range; var Mode = function() { - this.$tokenizer = new Tokenizer(new SqlHighlightRules().getRules()); + var highlighter = new SqlHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/stylus.js b/lib/ace/mode/stylus.js index 879f35fb..065348c6 100644 --- a/lib/ace/mode/stylus.js +++ b/lib/ace/mode/stylus.js @@ -51,6 +51,7 @@ var Mode = function() { this.foldingRules = new FoldMode(); this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/lib/ace/mode/text.js b/lib/ace/mode/text.js index e243ddbd..1af608a5 100644 --- a/lib/ace/mode/text.js +++ b/lib/ace/mode/text.js @@ -325,7 +325,38 @@ var Mode = function() { } } }; - + + this.getKeywords = function(append) { + // this is for autocompletion to pick up regexp'ed keywords + if (!this.completionKeywords) { + var rules = this.$tokenizer.rules; + var completionKeywords = []; + for (var rule in rules) { + var ruleItr = rules[rule]; + for (var r = 0, l = ruleItr.length; r < l; r++) { + if (typeof ruleItr[r].token === "string") { + if (/keyword|support|storage/.test(ruleItr[r].token)) + completionKeywords.push(ruleItr[r].regex); + } + else if (typeof ruleItr[r].token === "object") { + for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) { + if (/keyword|support|storage/.test(ruleItr[r].token[a])) { + // drop surrounding parens + var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a]; + completionKeywords.push(rule.substr(1, rule.length - 2)); + } + } + } + } + } + this.completionKeywords = completionKeywords; + } + // this is for highlighting embed rules, like HAML/Ruby or Obj-C/C + if (!append) + return this.$keywordList; + return completionKeywords.concat(this.$keywordList || []); + }; + }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 5d418ec8..d6dbd794 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -204,6 +204,7 @@ var TextHighlightRules = function() { for (var i = list.length; i--; ) keywords[list[i]] = className; }); + this.$keywordList = Object.keys(keywords); map = null; return ignoreCase ? function(value) {return keywords[value.toLowerCase()] || defaultToken } diff --git a/lib/ace/mouse/default_gutter_handler.js b/lib/ace/mouse/default_gutter_handler.js index fc971da6..55fcf108 100644 --- a/lib/ace/mouse/default_gutter_handler.js +++ b/lib/ace/mouse/default_gutter_handler.js @@ -38,7 +38,7 @@ function GutterHandler(mouseHandler) { var gutter = editor.renderer.$gutterLayer; mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { - if (!editor.isFocused()) + if (!editor.isFocused() || e.getButton() != 0) return; var gutterRegion = gutter.getRegion(e); diff --git a/lib/ace/multi_select.js b/lib/ace/multi_select.js index 2de7fc1d..41ca9b89 100644 --- a/lib/ace/multi_select.js +++ b/lib/ace/multi_select.js @@ -374,7 +374,7 @@ var Editor = require("./editor").Editor; /** * Removes the selection marker. - * @param {Range} The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. + * @param {Range} range The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. * @method Editor.removeSelectionMarker **/ this.removeSelectionMarker = function(range) { diff --git a/lib/ace/snippets.js b/lib/ace/snippets.js index da9533b1..35308b9d 100644 --- a/lib/ace/snippets.js +++ b/lib/ace/snippets.js @@ -533,7 +533,6 @@ var SnippetManager = function() { }).call(SnippetManager.prototype); - var TabstopManager = function(editor) { if (editor.tabstopManager) return editor.tabstopManager; diff --git a/lib/ace/snippets/abap.js b/lib/ace/snippets/abap.js new file mode 100644 index 00000000..902cb1bb --- /dev/null +++ b/lib/ace/snippets/abap.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./abap.snippets"); +exports.scope = "abap"; + +}); diff --git a/lib/ace/snippets/abap.snippets b/lib/ace/snippets/abap.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/actionscript.js b/lib/ace/snippets/actionscript.js new file mode 100644 index 00000000..5d4e2168 --- /dev/null +++ b/lib/ace/snippets/actionscript.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./actionscript.snippets"); +exports.scope = "actionscript"; + +}); diff --git a/lib/ace/snippets/ada.js b/lib/ace/snippets/ada.js new file mode 100644 index 00000000..5b3ea215 --- /dev/null +++ b/lib/ace/snippets/ada.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ada.snippets"); +exports.scope = "ada"; + +}); diff --git a/lib/ace/snippets/ada.snippets b/lib/ace/snippets/ada.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/asciidoc.js b/lib/ace/snippets/asciidoc.js new file mode 100644 index 00000000..7857020c --- /dev/null +++ b/lib/ace/snippets/asciidoc.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./asciidoc.snippets"); +exports.scope = "asciidoc"; + +}); diff --git a/lib/ace/snippets/asciidoc.snippets b/lib/ace/snippets/asciidoc.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/assembly_x86.js b/lib/ace/snippets/assembly_x86.js new file mode 100644 index 00000000..747335be --- /dev/null +++ b/lib/ace/snippets/assembly_x86.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./assembly_x86.snippets"); +exports.scope = "assembly_x86"; + +}); diff --git a/lib/ace/snippets/assembly_x86.snippets b/lib/ace/snippets/assembly_x86.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/autohotkey.js b/lib/ace/snippets/autohotkey.js new file mode 100644 index 00000000..064647e3 --- /dev/null +++ b/lib/ace/snippets/autohotkey.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./autohotkey.snippets"); +exports.scope = "autohotkey"; + +}); diff --git a/lib/ace/snippets/autohotkey.snippets b/lib/ace/snippets/autohotkey.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/batchfile.js b/lib/ace/snippets/batchfile.js new file mode 100644 index 00000000..ec949d96 --- /dev/null +++ b/lib/ace/snippets/batchfile.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./batchfile.snippets"); +exports.scope = "batchfile"; + +}); diff --git a/lib/ace/snippets/batchfile.snippets b/lib/ace/snippets/batchfile.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/c9search.js b/lib/ace/snippets/c9search.js new file mode 100644 index 00000000..62bc4403 --- /dev/null +++ b/lib/ace/snippets/c9search.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./c9search.snippets"); +exports.scope = "c9search"; + +}); diff --git a/lib/ace/snippets/c9search.snippets b/lib/ace/snippets/c9search.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/c_cpp.js b/lib/ace/snippets/c_cpp.js new file mode 100644 index 00000000..cf37a62a --- /dev/null +++ b/lib/ace/snippets/c_cpp.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./c_cpp.snippets"); +exports.scope = "c_cpp"; + +}); diff --git a/lib/ace/snippets/cpp.snippets b/lib/ace/snippets/c_cpp.snippets similarity index 100% rename from lib/ace/snippets/cpp.snippets rename to lib/ace/snippets/c_cpp.snippets diff --git a/lib/ace/snippets/clojure.js b/lib/ace/snippets/clojure.js new file mode 100644 index 00000000..8f07e5fe --- /dev/null +++ b/lib/ace/snippets/clojure.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./clojure.snippets"); +exports.scope = "clojure"; + +}); diff --git a/lib/ace/snippets/cobol.js b/lib/ace/snippets/cobol.js new file mode 100644 index 00000000..885f1c46 --- /dev/null +++ b/lib/ace/snippets/cobol.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./cobol.snippets"); +exports.scope = "cobol"; + +}); diff --git a/lib/ace/snippets/cobol.snippets b/lib/ace/snippets/cobol.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/coffee.js b/lib/ace/snippets/coffee.js new file mode 100644 index 00000000..5511ed11 --- /dev/null +++ b/lib/ace/snippets/coffee.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./coffee.snippets"); +exports.scope = "coffee"; + +}); diff --git a/lib/ace/snippets/coldfusion.js b/lib/ace/snippets/coldfusion.js new file mode 100644 index 00000000..6f44f9f7 --- /dev/null +++ b/lib/ace/snippets/coldfusion.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./coldfusion.snippets"); +exports.scope = "coldfusion"; + +}); diff --git a/lib/ace/snippets/coldfusion.snippets b/lib/ace/snippets/coldfusion.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/csharp.js b/lib/ace/snippets/csharp.js new file mode 100644 index 00000000..3aafdf85 --- /dev/null +++ b/lib/ace/snippets/csharp.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./csharp.snippets"); +exports.scope = "csharp"; + +}); diff --git a/lib/ace/snippets/csharp.snippets b/lib/ace/snippets/csharp.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/css.js b/lib/ace/snippets/css.js new file mode 100644 index 00000000..5d7e66ed --- /dev/null +++ b/lib/ace/snippets/css.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./css.snippets"); +exports.scope = "css"; + +}); diff --git a/lib/ace/snippets/curly.js b/lib/ace/snippets/curly.js new file mode 100644 index 00000000..aa59f286 --- /dev/null +++ b/lib/ace/snippets/curly.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./curly.snippets"); +exports.scope = "curly"; + +}); diff --git a/lib/ace/snippets/curly.snippets b/lib/ace/snippets/curly.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/d.js b/lib/ace/snippets/d.js new file mode 100644 index 00000000..79446fdc --- /dev/null +++ b/lib/ace/snippets/d.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./d.snippets"); +exports.scope = "d"; + +}); diff --git a/lib/ace/snippets/d.snippets b/lib/ace/snippets/d.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/dart.js b/lib/ace/snippets/dart.js new file mode 100644 index 00000000..949fcaa3 --- /dev/null +++ b/lib/ace/snippets/dart.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./dart.snippets"); +exports.scope = "dart"; + +}); diff --git a/lib/ace/snippets/diff.js b/lib/ace/snippets/diff.js new file mode 100644 index 00000000..eb48cbc1 --- /dev/null +++ b/lib/ace/snippets/diff.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./diff.snippets"); +exports.scope = "diff"; + +}); diff --git a/lib/ace/snippets/django.js b/lib/ace/snippets/django.js new file mode 100644 index 00000000..b5af7a73 --- /dev/null +++ b/lib/ace/snippets/django.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./django.snippets"); +exports.scope = "django"; + +}); diff --git a/lib/ace/snippets/dot.js b/lib/ace/snippets/dot.js new file mode 100644 index 00000000..420f4f01 --- /dev/null +++ b/lib/ace/snippets/dot.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./dot.snippets"); +exports.scope = "dot"; + +}); diff --git a/lib/ace/snippets/dot.snippets b/lib/ace/snippets/dot.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/ejs.js b/lib/ace/snippets/ejs.js new file mode 100644 index 00000000..be477738 --- /dev/null +++ b/lib/ace/snippets/ejs.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ejs.snippets"); +exports.scope = "ejs"; + +}); diff --git a/lib/ace/snippets/ejs.snippets b/lib/ace/snippets/ejs.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/erlang.js b/lib/ace/snippets/erlang.js new file mode 100644 index 00000000..212e3640 --- /dev/null +++ b/lib/ace/snippets/erlang.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./erlang.snippets"); +exports.scope = "erlang"; + +}); diff --git a/lib/ace/snippets/forth.js b/lib/ace/snippets/forth.js new file mode 100644 index 00000000..c2bf9107 --- /dev/null +++ b/lib/ace/snippets/forth.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./forth.snippets"); +exports.scope = "forth"; + +}); diff --git a/lib/ace/snippets/forth.snippets b/lib/ace/snippets/forth.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/ftl.js b/lib/ace/snippets/ftl.js new file mode 100644 index 00000000..1cbcc0be --- /dev/null +++ b/lib/ace/snippets/ftl.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ftl.snippets"); +exports.scope = "ftl"; + +}); diff --git a/lib/ace/snippets/ftl.snippets b/lib/ace/snippets/ftl.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/glsl.js b/lib/ace/snippets/glsl.js new file mode 100644 index 00000000..d9c5fc25 --- /dev/null +++ b/lib/ace/snippets/glsl.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./glsl.snippets"); +exports.scope = "glsl"; + +}); diff --git a/lib/ace/snippets/glsl.snippets b/lib/ace/snippets/glsl.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/golang.js b/lib/ace/snippets/golang.js new file mode 100644 index 00000000..f7b0eecc --- /dev/null +++ b/lib/ace/snippets/golang.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./golang.snippets"); +exports.scope = "golang"; + +}); diff --git a/lib/ace/snippets/golang.snippets b/lib/ace/snippets/golang.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/groovy.js b/lib/ace/snippets/groovy.js new file mode 100644 index 00000000..2fe4e111 --- /dev/null +++ b/lib/ace/snippets/groovy.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./groovy.snippets"); +exports.scope = "groovy"; + +}); diff --git a/lib/ace/snippets/groovy.snippets b/lib/ace/snippets/groovy.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/haml.js b/lib/ace/snippets/haml.js new file mode 100644 index 00000000..efa8eb9c --- /dev/null +++ b/lib/ace/snippets/haml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./haml.snippets"); +exports.scope = "haml"; + +}); diff --git a/lib/ace/snippets/haskell.js b/lib/ace/snippets/haskell.js new file mode 100644 index 00000000..8c583f1c --- /dev/null +++ b/lib/ace/snippets/haskell.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./haskell.snippets"); +exports.scope = "haskell"; + +}); diff --git a/lib/ace/snippets/haxe.js b/lib/ace/snippets/haxe.js new file mode 100644 index 00000000..b67f91eb --- /dev/null +++ b/lib/ace/snippets/haxe.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./haxe.snippets"); +exports.scope = "haxe"; + +}); diff --git a/lib/ace/snippets/haxe.snippets b/lib/ace/snippets/haxe.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/html.js b/lib/ace/snippets/html.js new file mode 100644 index 00000000..bac3bea3 --- /dev/null +++ b/lib/ace/snippets/html.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./html.snippets"); +exports.scope = "html"; + +}); diff --git a/lib/ace/snippets/html_ruby.js b/lib/ace/snippets/html_ruby.js new file mode 100644 index 00000000..d985d568 --- /dev/null +++ b/lib/ace/snippets/html_ruby.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./html_ruby.snippets"); +exports.scope = "html_ruby"; + +}); diff --git a/lib/ace/snippets/html_ruby.snippets b/lib/ace/snippets/html_ruby.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/ini.js b/lib/ace/snippets/ini.js new file mode 100644 index 00000000..df09d575 --- /dev/null +++ b/lib/ace/snippets/ini.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ini.snippets"); +exports.scope = "ini"; + +}); diff --git a/lib/ace/snippets/ini.snippets b/lib/ace/snippets/ini.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/jade.js b/lib/ace/snippets/jade.js new file mode 100644 index 00000000..ca83d483 --- /dev/null +++ b/lib/ace/snippets/jade.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./jade.snippets"); +exports.scope = "jade"; + +}); diff --git a/lib/ace/snippets/jade.snippets b/lib/ace/snippets/jade.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/java.js b/lib/ace/snippets/java.js new file mode 100644 index 00000000..7d05e84a --- /dev/null +++ b/lib/ace/snippets/java.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./java.snippets"); +exports.scope = "java"; + +}); diff --git a/lib/ace/snippets/javascript.js b/lib/ace/snippets/javascript.js index fe370b06..bf59ba85 100644 --- a/lib/ace/snippets/javascript.js +++ b/lib/ace/snippets/javascript.js @@ -2,6 +2,6 @@ define(function(require, exports, module) { "use strict"; exports.snippetText = require("../requirejs/text!./javascript.snippets"); - +exports.scope = "javascript"; }); diff --git a/lib/ace/snippets/json.js b/lib/ace/snippets/json.js new file mode 100644 index 00000000..d57fe6c5 --- /dev/null +++ b/lib/ace/snippets/json.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./json.snippets"); +exports.scope = "json"; + +}); diff --git a/lib/ace/snippets/json.snippets b/lib/ace/snippets/json.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/jsoniq.js b/lib/ace/snippets/jsoniq.js new file mode 100644 index 00000000..9bde24cf --- /dev/null +++ b/lib/ace/snippets/jsoniq.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./jsoniq.snippets"); +exports.scope = "jsoniq"; + +}); diff --git a/lib/ace/snippets/jsoniq.snippets b/lib/ace/snippets/jsoniq.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/jsp.js b/lib/ace/snippets/jsp.js new file mode 100644 index 00000000..2324c541 --- /dev/null +++ b/lib/ace/snippets/jsp.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./jsp.snippets"); +exports.scope = "jsp"; + +}); diff --git a/lib/ace/snippets/jsx.js b/lib/ace/snippets/jsx.js new file mode 100644 index 00000000..9792a7a0 --- /dev/null +++ b/lib/ace/snippets/jsx.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./jsx.snippets"); +exports.scope = "jsx"; + +}); diff --git a/lib/ace/snippets/jsx.snippets b/lib/ace/snippets/jsx.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/julia.js b/lib/ace/snippets/julia.js new file mode 100644 index 00000000..f83777ef --- /dev/null +++ b/lib/ace/snippets/julia.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./julia.snippets"); +exports.scope = "julia"; + +}); diff --git a/lib/ace/snippets/julia.snippets b/lib/ace/snippets/julia.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/latex.js b/lib/ace/snippets/latex.js new file mode 100644 index 00000000..44bef369 --- /dev/null +++ b/lib/ace/snippets/latex.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./latex.snippets"); +exports.scope = "latex"; + +}); diff --git a/lib/ace/snippets/latex.snippets b/lib/ace/snippets/latex.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/less.js b/lib/ace/snippets/less.js new file mode 100644 index 00000000..7acf02f2 --- /dev/null +++ b/lib/ace/snippets/less.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./less.snippets"); +exports.scope = "less"; + +}); diff --git a/lib/ace/snippets/less.snippets b/lib/ace/snippets/less.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/liquid.js b/lib/ace/snippets/liquid.js new file mode 100644 index 00000000..2e320755 --- /dev/null +++ b/lib/ace/snippets/liquid.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./liquid.snippets"); +exports.scope = "liquid"; + +}); diff --git a/lib/ace/snippets/liquid.snippets b/lib/ace/snippets/liquid.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/lisp.js b/lib/ace/snippets/lisp.js new file mode 100644 index 00000000..2b6870bc --- /dev/null +++ b/lib/ace/snippets/lisp.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./lisp.snippets"); +exports.scope = "lisp"; + +}); diff --git a/lib/ace/snippets/lisp.snippets b/lib/ace/snippets/lisp.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/livescript.js b/lib/ace/snippets/livescript.js new file mode 100644 index 00000000..ba20e7e4 --- /dev/null +++ b/lib/ace/snippets/livescript.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./livescript.snippets"); +exports.scope = "livescript"; + +}); diff --git a/lib/ace/snippets/livescript.snippets b/lib/ace/snippets/livescript.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/logiql.js b/lib/ace/snippets/logiql.js new file mode 100644 index 00000000..7d0167da --- /dev/null +++ b/lib/ace/snippets/logiql.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./logiql.snippets"); +exports.scope = "logiql"; + +}); diff --git a/lib/ace/snippets/logiql.snippets b/lib/ace/snippets/logiql.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/lsl.js b/lib/ace/snippets/lsl.js new file mode 100644 index 00000000..678ba41f --- /dev/null +++ b/lib/ace/snippets/lsl.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./lsl.snippets"); +exports.scope = "lsl"; + +}); diff --git a/lib/ace/snippets/lua.js b/lib/ace/snippets/lua.js new file mode 100644 index 00000000..0ab6fdcd --- /dev/null +++ b/lib/ace/snippets/lua.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./lua.snippets"); +exports.scope = "lua"; + +}); diff --git a/lib/ace/snippets/luapage.js b/lib/ace/snippets/luapage.js new file mode 100644 index 00000000..86b22842 --- /dev/null +++ b/lib/ace/snippets/luapage.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./luapage.snippets"); +exports.scope = "luapage"; + +}); diff --git a/lib/ace/snippets/luapage.snippets b/lib/ace/snippets/luapage.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/lucene.js b/lib/ace/snippets/lucene.js new file mode 100644 index 00000000..01edb07d --- /dev/null +++ b/lib/ace/snippets/lucene.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./lucene.snippets"); +exports.scope = "lucene"; + +}); diff --git a/lib/ace/snippets/lucene.snippets b/lib/ace/snippets/lucene.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/makefile.js b/lib/ace/snippets/makefile.js new file mode 100644 index 00000000..0ec05ac0 --- /dev/null +++ b/lib/ace/snippets/makefile.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./makefile.snippets"); +exports.scope = "makefile"; + +}); diff --git a/lib/ace/snippets/make.snippets b/lib/ace/snippets/makefile.snippets similarity index 100% rename from lib/ace/snippets/make.snippets rename to lib/ace/snippets/makefile.snippets diff --git a/lib/ace/snippets/markdown.js b/lib/ace/snippets/markdown.js new file mode 100644 index 00000000..3940bc90 --- /dev/null +++ b/lib/ace/snippets/markdown.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./markdown.snippets"); +exports.scope = "markdown"; + +}); diff --git a/lib/ace/snippets/matlab.js b/lib/ace/snippets/matlab.js new file mode 100644 index 00000000..698366ba --- /dev/null +++ b/lib/ace/snippets/matlab.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./matlab.snippets"); +exports.scope = "matlab"; + +}); diff --git a/lib/ace/snippets/matlab.snippets b/lib/ace/snippets/matlab.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/mushcode.js b/lib/ace/snippets/mushcode.js new file mode 100644 index 00000000..8b0d2dcb --- /dev/null +++ b/lib/ace/snippets/mushcode.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./mushcode.snippets"); +exports.scope = "mushcode"; + +}); diff --git a/lib/ace/snippets/mushcode.snippets b/lib/ace/snippets/mushcode.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/mushcode_high_rules.js b/lib/ace/snippets/mushcode_high_rules.js new file mode 100644 index 00000000..25d42827 --- /dev/null +++ b/lib/ace/snippets/mushcode_high_rules.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./mushcode_high_rules.snippets"); +exports.scope = "mushcode_high_rules"; + +}); diff --git a/lib/ace/snippets/mushcode_high_rules.snippets b/lib/ace/snippets/mushcode_high_rules.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/mysql.js b/lib/ace/snippets/mysql.js new file mode 100644 index 00000000..e5462390 --- /dev/null +++ b/lib/ace/snippets/mysql.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./mysql.snippets"); +exports.scope = "mysql"; + +}); diff --git a/lib/ace/snippets/mysql.snippets b/lib/ace/snippets/mysql.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/objectivec.js b/lib/ace/snippets/objectivec.js new file mode 100644 index 00000000..ed5d5fa8 --- /dev/null +++ b/lib/ace/snippets/objectivec.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./objectivec.snippets"); +exports.scope = "objectivec"; + +}); diff --git a/lib/ace/snippets/objectivec.snippets b/lib/ace/snippets/objectivec.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/ocaml.js b/lib/ace/snippets/ocaml.js new file mode 100644 index 00000000..a6e6842e --- /dev/null +++ b/lib/ace/snippets/ocaml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ocaml.snippets"); +exports.scope = "ocaml"; + +}); diff --git a/lib/ace/snippets/ocaml.snippets b/lib/ace/snippets/ocaml.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/pascal.js b/lib/ace/snippets/pascal.js new file mode 100644 index 00000000..cd8f19fe --- /dev/null +++ b/lib/ace/snippets/pascal.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./pascal.snippets"); +exports.scope = "pascal"; + +}); diff --git a/lib/ace/snippets/pascal.snippets b/lib/ace/snippets/pascal.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/perl.js b/lib/ace/snippets/perl.js new file mode 100644 index 00000000..9b1fbe8d --- /dev/null +++ b/lib/ace/snippets/perl.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./perl.snippets"); +exports.scope = "perl"; + +}); diff --git a/lib/ace/snippets/pgsql.js b/lib/ace/snippets/pgsql.js new file mode 100644 index 00000000..9bbd9012 --- /dev/null +++ b/lib/ace/snippets/pgsql.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./pgsql.snippets"); +exports.scope = "pgsql"; + +}); diff --git a/lib/ace/snippets/pgsql.snippets b/lib/ace/snippets/pgsql.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/php.js b/lib/ace/snippets/php.js new file mode 100644 index 00000000..b8f8ce0e --- /dev/null +++ b/lib/ace/snippets/php.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./php.snippets"); +exports.scope = "php"; + +}); diff --git a/lib/ace/snippets/powershell.js b/lib/ace/snippets/powershell.js new file mode 100644 index 00000000..4639a304 --- /dev/null +++ b/lib/ace/snippets/powershell.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./powershell.snippets"); +exports.scope = "powershell"; + +}); diff --git a/lib/ace/snippets/powershell.snippets b/lib/ace/snippets/powershell.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/prolog.js b/lib/ace/snippets/prolog.js new file mode 100644 index 00000000..7c9d0fbc --- /dev/null +++ b/lib/ace/snippets/prolog.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./prolog.snippets"); +exports.scope = "prolog"; + +}); diff --git a/lib/ace/snippets/prolog.snippets b/lib/ace/snippets/prolog.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/properties.js b/lib/ace/snippets/properties.js new file mode 100644 index 00000000..18bd3883 --- /dev/null +++ b/lib/ace/snippets/properties.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./properties.snippets"); +exports.scope = "properties"; + +}); diff --git a/lib/ace/snippets/properties.snippets b/lib/ace/snippets/properties.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/python.js b/lib/ace/snippets/python.js new file mode 100644 index 00000000..48ddba28 --- /dev/null +++ b/lib/ace/snippets/python.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./python.snippets"); +exports.scope = "python"; + +}); diff --git a/lib/ace/snippets/r.js b/lib/ace/snippets/r.js new file mode 100644 index 00000000..6b319194 --- /dev/null +++ b/lib/ace/snippets/r.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./r.snippets"); +exports.scope = "r"; + +}); diff --git a/lib/ace/snippets/rdoc.js b/lib/ace/snippets/rdoc.js new file mode 100644 index 00000000..0d9e6c95 --- /dev/null +++ b/lib/ace/snippets/rdoc.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./rdoc.snippets"); +exports.scope = "rdoc"; + +}); diff --git a/lib/ace/snippets/rdoc.snippets b/lib/ace/snippets/rdoc.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/rhtml.js b/lib/ace/snippets/rhtml.js new file mode 100644 index 00000000..96707f21 --- /dev/null +++ b/lib/ace/snippets/rhtml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./rhtml.snippets"); +exports.scope = "rhtml"; + +}); diff --git a/lib/ace/snippets/rhtml.snippets b/lib/ace/snippets/rhtml.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/ruby.js b/lib/ace/snippets/ruby.js new file mode 100644 index 00000000..f7050449 --- /dev/null +++ b/lib/ace/snippets/ruby.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./ruby.snippets"); +exports.scope = "ruby"; + +}); diff --git a/lib/ace/snippets/rust.js b/lib/ace/snippets/rust.js new file mode 100644 index 00000000..556d9a6b --- /dev/null +++ b/lib/ace/snippets/rust.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./rust.snippets"); +exports.scope = "rust"; + +}); diff --git a/lib/ace/snippets/rust.snippets b/lib/ace/snippets/rust.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/sass.js b/lib/ace/snippets/sass.js new file mode 100644 index 00000000..ba728ac2 --- /dev/null +++ b/lib/ace/snippets/sass.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./sass.snippets"); +exports.scope = "sass"; + +}); diff --git a/lib/ace/snippets/sass.snippets b/lib/ace/snippets/sass.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/scad.js b/lib/ace/snippets/scad.js new file mode 100644 index 00000000..28db2155 --- /dev/null +++ b/lib/ace/snippets/scad.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./scad.snippets"); +exports.scope = "scad"; + +}); diff --git a/lib/ace/snippets/scad.snippets b/lib/ace/snippets/scad.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/scala.js b/lib/ace/snippets/scala.js new file mode 100644 index 00000000..2e5a8c57 --- /dev/null +++ b/lib/ace/snippets/scala.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./scala.snippets"); +exports.scope = "scala"; + +}); diff --git a/lib/ace/snippets/scala.snippets b/lib/ace/snippets/scala.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/scheme.js b/lib/ace/snippets/scheme.js new file mode 100644 index 00000000..7d3c6f65 --- /dev/null +++ b/lib/ace/snippets/scheme.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./scheme.snippets"); +exports.scope = "scheme"; + +}); diff --git a/lib/ace/snippets/scheme.snippets b/lib/ace/snippets/scheme.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/scss.js b/lib/ace/snippets/scss.js new file mode 100644 index 00000000..a940eabd --- /dev/null +++ b/lib/ace/snippets/scss.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./scss.snippets"); +exports.scope = "scss"; + +}); diff --git a/lib/ace/snippets/scss.snippets b/lib/ace/snippets/scss.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/sh.js b/lib/ace/snippets/sh.js new file mode 100644 index 00000000..c48dc17f --- /dev/null +++ b/lib/ace/snippets/sh.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./sh.snippets"); +exports.scope = "sh"; + +}); diff --git a/lib/ace/snippets/snippets.js b/lib/ace/snippets/snippets.js new file mode 100644 index 00000000..0927805b --- /dev/null +++ b/lib/ace/snippets/snippets.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./snippets.snippets"); +exports.scope = "snippets"; + +}); diff --git a/lib/ace/snippets/sql.js b/lib/ace/snippets/sql.js new file mode 100644 index 00000000..c96f6cb2 --- /dev/null +++ b/lib/ace/snippets/sql.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./sql.snippets"); +exports.scope = "sql"; + +}); diff --git a/lib/ace/snippets/stylus.js b/lib/ace/snippets/stylus.js new file mode 100644 index 00000000..86a79f7a --- /dev/null +++ b/lib/ace/snippets/stylus.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./stylus.snippets"); +exports.scope = "stylus"; + +}); diff --git a/lib/ace/snippets/stylus.snippets b/lib/ace/snippets/stylus.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/svg.js b/lib/ace/snippets/svg.js new file mode 100644 index 00000000..aeb62456 --- /dev/null +++ b/lib/ace/snippets/svg.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./svg.snippets"); +exports.scope = "svg"; + +}); diff --git a/lib/ace/snippets/svg.snippets b/lib/ace/snippets/svg.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/tcl.js b/lib/ace/snippets/tcl.js new file mode 100644 index 00000000..53482fc7 --- /dev/null +++ b/lib/ace/snippets/tcl.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./tcl.snippets"); +exports.scope = "tcl"; + +}); diff --git a/lib/ace/snippets/tex.js b/lib/ace/snippets/tex.js new file mode 100644 index 00000000..267b6b69 --- /dev/null +++ b/lib/ace/snippets/tex.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./tex.snippets"); +exports.scope = "tex"; + +}); diff --git a/lib/ace/snippets/text.js b/lib/ace/snippets/text.js new file mode 100644 index 00000000..434d75be --- /dev/null +++ b/lib/ace/snippets/text.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./text.snippets"); +exports.scope = "text"; + +}); diff --git a/lib/ace/snippets/text.snippets b/lib/ace/snippets/text.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/textile.js b/lib/ace/snippets/textile.js new file mode 100644 index 00000000..f2622e05 --- /dev/null +++ b/lib/ace/snippets/textile.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./textile.snippets"); +exports.scope = "textile"; + +}); diff --git a/lib/ace/snippets/tmsnippet.snippets b/lib/ace/snippets/tmsnippet.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/toml.js b/lib/ace/snippets/toml.js new file mode 100644 index 00000000..419b06d8 --- /dev/null +++ b/lib/ace/snippets/toml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./toml.snippets"); +exports.scope = "toml"; + +}); diff --git a/lib/ace/snippets/toml.snippets b/lib/ace/snippets/toml.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/twig.js b/lib/ace/snippets/twig.js new file mode 100644 index 00000000..b08b884c --- /dev/null +++ b/lib/ace/snippets/twig.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./twig.snippets"); +exports.scope = "twig"; + +}); diff --git a/lib/ace/snippets/twig.snippets b/lib/ace/snippets/twig.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/typescript.js b/lib/ace/snippets/typescript.js new file mode 100644 index 00000000..495da3f3 --- /dev/null +++ b/lib/ace/snippets/typescript.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./typescript.snippets"); +exports.scope = "typescript"; + +}); diff --git a/lib/ace/snippets/typescript.snippets b/lib/ace/snippets/typescript.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/vbscript.js b/lib/ace/snippets/vbscript.js new file mode 100644 index 00000000..5ab8e650 --- /dev/null +++ b/lib/ace/snippets/vbscript.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./vbscript.snippets"); +exports.scope = "vbscript"; + +}); diff --git a/lib/ace/snippets/vbscript.snippets b/lib/ace/snippets/vbscript.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/velocity.js b/lib/ace/snippets/velocity.js new file mode 100644 index 00000000..ef59f621 --- /dev/null +++ b/lib/ace/snippets/velocity.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./velocity.snippets"); +exports.scope = "velocity"; + +}); diff --git a/lib/ace/snippets/velocity.snippets b/lib/ace/snippets/velocity.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/verilog.js b/lib/ace/snippets/verilog.js new file mode 100644 index 00000000..7360341e --- /dev/null +++ b/lib/ace/snippets/verilog.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./verilog.snippets"); +exports.scope = "verilog"; + +}); diff --git a/lib/ace/snippets/verilog.snippets b/lib/ace/snippets/verilog.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/xml.js b/lib/ace/snippets/xml.js new file mode 100644 index 00000000..83b1870c --- /dev/null +++ b/lib/ace/snippets/xml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./xml.snippets"); +exports.scope = "xml"; + +}); diff --git a/lib/ace/snippets/xml.snippets b/lib/ace/snippets/xml.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/xquery.js b/lib/ace/snippets/xquery.js new file mode 100644 index 00000000..d96a0619 --- /dev/null +++ b/lib/ace/snippets/xquery.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./xquery.snippets"); +exports.scope = "xquery"; + +}); diff --git a/lib/ace/snippets/xquery.snippets b/lib/ace/snippets/xquery.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/yaml.js b/lib/ace/snippets/yaml.js new file mode 100644 index 00000000..17e70a3c --- /dev/null +++ b/lib/ace/snippets/yaml.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./yaml.snippets"); +exports.scope = "yaml"; + +}); diff --git a/lib/ace/snippets/yaml.snippets b/lib/ace/snippets/yaml.snippets new file mode 100644 index 00000000..e69de29b diff --git a/tool/mode.tmpl.js b/tool/mode.tmpl.js index 054cb7e6..bdf8065e 100644 --- a/tool/mode.tmpl.js +++ b/tool/mode.tmpl.js @@ -51,6 +51,7 @@ var Mode = function() { var highlighter = new %language%HighlightRules(); this.foldingRules = new FoldMode(); this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$keywordList = highlighter.$keywordList; }; oop.inherits(Mode, TextMode); diff --git a/tool/tmtheme.js b/tool/tmtheme.js index 7bfc07ea..c01fb16f 100755 --- a/tool/tmtheme.js +++ b/tool/tmtheme.js @@ -247,6 +247,7 @@ var themes = { "pastel_on_dark": "Pastels on Dark", "solarized_dark": "Solarized-dark", "solarized_light": "Solarized-light", + "katzenmilch": "Katzenmilch", //"textmate": "Textmate (Mac Classic)", "tomorrow": "Tomorrow", "tomorrow_night": "Tomorrow-Night",