mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
Merge pull request +6936 from c9/update-ace
Update ace
This commit is contained in:
commit
4e2778e49c
15
node_modules/ace/CONTRIBUTING.md
generated
vendored
15
node_modules/ace/CONTRIBUTING.md
generated
vendored
@ -7,16 +7,9 @@ Feel free to fork and improve/enhance Ace any way you want. If you feel that the
|
||||
|
||||
There are two versions of the agreement:
|
||||
|
||||
1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
|
||||
2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
|
||||
1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
|
||||
2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects.
|
||||
|
||||
If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.
|
||||
If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it.
|
||||
|
||||
Email: ace+cla@c9.io
|
||||
|
||||
Fax: +31 (0) 206388953
|
||||
|
||||
Address: Ajax.org B.V.
|
||||
Keizersgracht 241
|
||||
1016 EA, Amsterdam
|
||||
the Netherlands
|
||||
Happy coding, Cloud9
|
||||
|
||||
2
node_modules/ace/ChangeLog.txt
generated
vendored
2
node_modules/ace/ChangeLog.txt
generated
vendored
@ -1,3 +1,5 @@
|
||||
2015.04.03 Version 1.1.9
|
||||
|
||||
2014.11.08 Version 1.1.8
|
||||
|
||||
* API Changes
|
||||
|
||||
9
node_modules/ace/Makefile.dryice.js
generated
vendored
9
node_modules/ace/Makefile.dryice.js
generated
vendored
@ -307,6 +307,7 @@ function buildAceModuleInternal(opts, callback) {
|
||||
ignore: opts.ignore || [],
|
||||
withRequire: false,
|
||||
basepath: ACE_HOME,
|
||||
transforms: [normalizeLineEndings],
|
||||
afterRead: [optimizeTextModules]
|
||||
}, write);
|
||||
}
|
||||
@ -407,6 +408,10 @@ function getLoadedFileList(options, callback, result) {
|
||||
callback(Object.keys(deps));
|
||||
}
|
||||
|
||||
function normalizeLineEndings(module) {
|
||||
module.source = module.source.replace(/\r\n/g, "\n");
|
||||
}
|
||||
|
||||
function optimizeTextModules(sources) {
|
||||
var textModules = {};
|
||||
return sources.filter(function(pkg) {
|
||||
@ -452,10 +457,10 @@ function optimizeTextModules(sources) {
|
||||
if (/\.css$/.test(pkg.id)) {
|
||||
// remove unnecessary whitespace from css
|
||||
input = input.replace(/\n\s+/g, "\n");
|
||||
input = '"' + input.replace(/\r?\n/g, '\\\n') + '"';
|
||||
input = '"' + input.replace(/\n/g, '\\\n') + '"';
|
||||
} else {
|
||||
// but don't break other files!
|
||||
input = '"' + input.replace(/\r?\n/g, '\\n\\\n') + '"';
|
||||
input = '"' + input.replace(/\n/g, '\\n\\\n') + '"';
|
||||
}
|
||||
textModules[pkg.id] = input;
|
||||
}
|
||||
|
||||
2
node_modules/ace/Readme.md
generated
vendored
2
node_modules/ace/Readme.md
generated
vendored
@ -79,7 +79,7 @@ By default the editor only supports plain text mode; many other languages are av
|
||||
The mode can then be used like this:
|
||||
|
||||
```javascript
|
||||
var JavaScriptMode = require("ace/mode/javascript").Mode;
|
||||
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
|
||||
editor.getSession().setMode(new JavaScriptMode());
|
||||
```
|
||||
|
||||
|
||||
87
node_modules/ace/build_support/mini_require.js
generated
vendored
87
node_modules/ace/build_support/mini_require.js
generated
vendored
@ -38,69 +38,62 @@
|
||||
|
||||
var ACE_NAMESPACE = "";
|
||||
|
||||
var global = (function() {
|
||||
return this;
|
||||
})();
|
||||
var global = (function() { return this; })();
|
||||
if (!global && typeof window != "undefined") global = window; // strict mode
|
||||
|
||||
|
||||
if (!ACE_NAMESPACE && typeof requirejs !== "undefined")
|
||||
return;
|
||||
|
||||
|
||||
var _define = function(module, deps, payload) {
|
||||
if (typeof module !== 'string') {
|
||||
if (_define.original)
|
||||
_define.original.apply(window, arguments);
|
||||
var define = function(module, deps, payload) {
|
||||
if (typeof module !== "string") {
|
||||
if (define.original)
|
||||
define.original.apply(this, arguments);
|
||||
else {
|
||||
console.error('dropping module because define wasn\'t a string.');
|
||||
console.error("dropping module because define wasn\'t a string.");
|
||||
console.trace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (arguments.length == 2)
|
||||
payload = deps;
|
||||
|
||||
if (!_define.modules) {
|
||||
_define.modules = {};
|
||||
_define.payloads = {};
|
||||
if (!define.modules[module]) {
|
||||
define.payloads[module] = payload;
|
||||
define.modules[module] = null;
|
||||
}
|
||||
|
||||
_define.payloads[module] = payload;
|
||||
_define.modules[module] = null;
|
||||
};
|
||||
|
||||
define.modules = {};
|
||||
define.payloads = {};
|
||||
|
||||
/**
|
||||
* Get at functionality define()ed using the function above
|
||||
*/
|
||||
var _require = function(parentId, module, callback) {
|
||||
if (Object.prototype.toString.call(module) === "[object Array]") {
|
||||
if (typeof module === "string") {
|
||||
var payload = lookup(parentId, module);
|
||||
if (payload != undefined) {
|
||||
callback && callback();
|
||||
return payload;
|
||||
}
|
||||
} else if (Object.prototype.toString.call(module) === "[object Array]") {
|
||||
var params = [];
|
||||
for (var i = 0, l = module.length; i < l; ++i) {
|
||||
var dep = lookup(parentId, module[i]);
|
||||
if (!dep && _require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
if (dep == undefined && require.original)
|
||||
return;
|
||||
params.push(dep);
|
||||
}
|
||||
if (callback) {
|
||||
callback.apply(null, params);
|
||||
}
|
||||
return callback && callback.apply(null, params) || true;
|
||||
}
|
||||
else if (typeof module === 'string') {
|
||||
var payload = lookup(parentId, module);
|
||||
if (!payload && _require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
};
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
return payload;
|
||||
}
|
||||
else {
|
||||
if (_require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
}
|
||||
var require = function(module, callback) {
|
||||
var packagedModule = _require("", module, callback);
|
||||
if (packagedModule == undefined && require.original)
|
||||
return require.original.apply(this, arguments);
|
||||
return packagedModule;
|
||||
};
|
||||
|
||||
var normalizeModule = function(parentId, moduleName) {
|
||||
@ -119,7 +112,6 @@ var normalizeModule = function(parentId, moduleName) {
|
||||
moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
|
||||
}
|
||||
}
|
||||
|
||||
return moduleName;
|
||||
};
|
||||
|
||||
@ -128,12 +120,11 @@ var normalizeModule = function(parentId, moduleName) {
|
||||
* definition function if needed.
|
||||
*/
|
||||
var lookup = function(parentId, moduleName) {
|
||||
|
||||
moduleName = normalizeModule(parentId, moduleName);
|
||||
|
||||
var module = _define.modules[moduleName];
|
||||
var module = define.modules[moduleName];
|
||||
if (!module) {
|
||||
module = _define.payloads[moduleName];
|
||||
module = define.payloads[moduleName];
|
||||
if (typeof module === 'function') {
|
||||
var exports = {};
|
||||
var mod = {
|
||||
@ -149,19 +140,15 @@ var lookup = function(parentId, moduleName) {
|
||||
|
||||
var returnValue = module(req, exports, mod);
|
||||
exports = returnValue || mod.exports;
|
||||
_define.modules[moduleName] = exports;
|
||||
delete _define.payloads[moduleName];
|
||||
define.modules[moduleName] = exports;
|
||||
delete define.payloads[moduleName];
|
||||
}
|
||||
module = _define.modules[moduleName] = exports || module;
|
||||
module = define.modules[moduleName] = exports || module;
|
||||
}
|
||||
return module;
|
||||
};
|
||||
|
||||
function exportAce(ns) {
|
||||
var require = function(module, callback) {
|
||||
return _require("", module, callback);
|
||||
};
|
||||
|
||||
var root = global;
|
||||
if (ns) {
|
||||
if (!global[ns])
|
||||
@ -170,13 +157,13 @@ function exportAce(ns) {
|
||||
}
|
||||
|
||||
if (!root.define || !root.define.packaged) {
|
||||
_define.original = root.define;
|
||||
root.define = _define;
|
||||
define.original = root.define;
|
||||
root.define = define;
|
||||
root.define.packaged = true;
|
||||
}
|
||||
|
||||
if (!root.require || !root.require.packaged) {
|
||||
_require.original = root.require;
|
||||
require.original = root.require;
|
||||
root.require = require;
|
||||
root.require.packaged = true;
|
||||
}
|
||||
|
||||
2
node_modules/ace/demo/emmet.html
generated
vendored
2
node_modules/ace/demo/emmet.html
generated
vendored
@ -23,7 +23,7 @@
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<!-- load emmet code and snippets compiled for browser -->
|
||||
<script src="https://nightwing.github.io/emmet-core/emmet.js"></script>
|
||||
<script src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
|
||||
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
|
||||
2
node_modules/ace/demo/kitchen-sink/demo.js
generated
vendored
2
node_modules/ace/demo/kitchen-sink/demo.js
generated
vendored
@ -531,7 +531,7 @@ new StatusBar(env.editor, cmdLine.container);
|
||||
|
||||
|
||||
var Emmet = require("ace/ext/emmet");
|
||||
net.loadScript("https://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||
net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
|
||||
Emmet.setCore(window.emmet);
|
||||
env.editor.setOption("enableEmmet", true);
|
||||
});
|
||||
|
||||
9
node_modules/ace/demo/kitchen-sink/docs/lean.lean
generated
vendored
Normal file
9
node_modules/ace/demo/kitchen-sink/docs/lean.lean
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import logic
|
||||
section
|
||||
variables (A : Type) (p q : A → Prop)
|
||||
|
||||
example : (∀x : A, p x ∧ q x) → ∀y : A, p y :=
|
||||
assume H : ∀x : A, p x ∧ q x,
|
||||
take y : A,
|
||||
show p y, from and.elim_left (H y)
|
||||
end
|
||||
63
node_modules/ace/demo/kitchen-sink/docs/sqlserver.sqlserver
generated
vendored
Normal file
63
node_modules/ace/demo/kitchen-sink/docs/sqlserver.sqlserver
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
-- =============================================
|
||||
-- Author: Morgan Yarbrough
|
||||
-- Create date: 4/27/2015
|
||||
-- Description: Test Procedure that shows off language features.
|
||||
-- Includes non-standard folding using region comments using either
|
||||
-- line comments or block comments (both are demonstrated below)
|
||||
-- This mode imitates SSMS and it designed to be used with SQL Server theme.
|
||||
-- =============================================
|
||||
CREATE PROCEDURE dbo.TestProcedure
|
||||
|
||||
--#region parameters
|
||||
@vint INT = 1
|
||||
,@vdate DATE = NULL
|
||||
,@vdatetime DATETIME = DATEADD (dd, 1, GETDATE())
|
||||
,@vvarchar VARCHAR(MAX) = ''
|
||||
--#endregion
|
||||
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
/*#region set statements */
|
||||
SET NOCOUNT ON;
|
||||
SET XACT_ABORT ON;
|
||||
SET QUOTED_IDENTIFIER ON;
|
||||
/*#endregion*/
|
||||
|
||||
/**
|
||||
* These comments will produce a fold widget
|
||||
*/
|
||||
|
||||
-- folding demonstration
|
||||
SET @vint = CASE
|
||||
WHEN @vdate IS NULL
|
||||
THEN 1
|
||||
ELSE 2
|
||||
END
|
||||
|
||||
-- another folding demonstration
|
||||
IF @vint = 1
|
||||
BEGIN
|
||||
SET @vvarchar='one'
|
||||
SET @vint = DATEDIFFT(dd, @vdate, @vdatetime)
|
||||
END
|
||||
|
||||
-- this mode handles strings properly
|
||||
DECLARE @sql NVARCHAR(4000) = N'SELECT TOP(1) OrderID
|
||||
FROM Orders
|
||||
WHERE @OrderDate > GETDATE()'
|
||||
|
||||
-- this mode is aware of build in stored procedures
|
||||
EXECUTE sp_executesql @sql
|
||||
|
||||
-- demonstrating some syntax highlighting
|
||||
SELECT Orders.OrderID
|
||||
,Customers.CompanyName
|
||||
,DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear
|
||||
FROM Orders
|
||||
INNER JOIN Customers
|
||||
ON Orders.CustomerID = Customers.CustomerID
|
||||
WHERE CompanyName NOT LIKE '%something'
|
||||
OR CompanyName IS NULL
|
||||
OR CompanyName IN ('bla', 'nothing')
|
||||
END
|
||||
29
node_modules/ace/demo/static-highlighter.html
generated
vendored
29
node_modules/ace/demo/static-highlighter.html
generated
vendored
@ -2,13 +2,13 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Static Code highlighter using Ace</title>
|
||||
<meta name="author" content="Matthew Kastor">
|
||||
<title>Static Code highlighter using Ace</title>
|
||||
<meta name="author" content="Matthew Kastor">
|
||||
<style type="text/css">
|
||||
.code {
|
||||
width: 50%;
|
||||
position: relative;
|
||||
white-space: pre-wrap;
|
||||
border: solid lightgrey 1px
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@ -21,9 +21,8 @@
|
||||
<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome" ace-gutter="true">
|
||||
.code {
|
||||
width: 50%;
|
||||
|
||||
position: relative;
|
||||
white-space: pre-wrap;
|
||||
border: solid lightgrey 1px
|
||||
}
|
||||
|
||||
</div>
|
||||
@ -35,6 +34,26 @@ function wobble (flam) {
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
<div class="code" ace-mode="ace/mode/lua" ace-theme="ace/theme/chrome" ace-gutter="true" style="width: 30em;">
|
||||
--[[--
|
||||
num_args takes in 5.1 byte code and extracts the number of arguments from its function header.
|
||||
--]]--
|
||||
|
||||
function int(t)
|
||||
return t:byte(1) + t:byte(2) * 0x100 + t:byte(3) * 0x10000 + t:byte(4) * 0x1000000
|
||||
end
|
||||
|
||||
function num_args(func)
|
||||
local dump = string.dump(func)
|
||||
local offset, cursor = int(dump:sub(13)), offset + 26
|
||||
--Get the params and var flag (whether there's a ... in the param)
|
||||
return dump:sub(cursor):byte(), dump:sub(cursor+1):byte()
|
||||
end
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
|
||||
2
node_modules/ace/demo/static-highlighter/server.js
generated
vendored
2
node_modules/ace/demo/static-highlighter/server.js
generated
vendored
@ -21,7 +21,7 @@ var port = process.env.PORT || 2222;
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
res.writeHead(200, {"Content-Type": "text/html; charset=utf-8"});
|
||||
fs.readFile(__filename, "utf8", function(err, data) {
|
||||
fs.readFile(__dirname + "/../../build/src/ace.js", "utf8", function(err, data) {
|
||||
var highlighted = highlighter.render(data, new JavaScriptMode(), theme);
|
||||
res.end(
|
||||
'<html><body>\n' +
|
||||
|
||||
BIN
node_modules/ace/doc/Contributor_License_Agreement-v2.pdf
generated
vendored
BIN
node_modules/ace/doc/Contributor_License_Agreement-v2.pdf
generated
vendored
Binary file not shown.
BIN
node_modules/ace/doc/Corporate_Contributor_License_Agreement-v2.pdf
generated
vendored
BIN
node_modules/ace/doc/Corporate_Contributor_License_Agreement-v2.pdf
generated
vendored
Binary file not shown.
2
node_modules/ace/doc/site/js/main.js
generated
vendored
2
node_modules/ace/doc/site/js/main.js
generated
vendored
@ -18,7 +18,7 @@ $(function() {
|
||||
});
|
||||
|
||||
ace.config.loadModule("ace/ext/emmet", function() {
|
||||
ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||
ace.require("ace/lib/net").loadScript("http://cloud9ide.github.io/emmet-core/emmet.js", function() {
|
||||
embedded_editor.setOption("enableEmmet", true);
|
||||
editor.setOption("enableEmmet", true);
|
||||
});
|
||||
|
||||
9
node_modules/ace/index.html
generated
vendored
9
node_modules/ace/index.html
generated
vendored
@ -470,7 +470,6 @@ var fonts = lang.arrayToMap(
|
||||
<pre><code class="language-javascript">this.$rules = {
|
||||
"start" : [ {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : "<\\!\\[CDATA\\[",
|
||||
next : "cdata"
|
||||
},
|
||||
@ -480,13 +479,7 @@ var fonts = lang.arrayToMap(
|
||||
regex : "\\]\\]>",
|
||||
next : "start"
|
||||
}, {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : "\\s+"
|
||||
}, {
|
||||
token : "text",
|
||||
merge : true,
|
||||
regex : ".+"
|
||||
defaultToken : "text"
|
||||
} ]
|
||||
};</code></pre>
|
||||
<p>In this extremly short sample, we're defining some highlighting rules for when Ace detectes a <code><![CDATA</code> tag. When one is encountered, the tokenizer moves from <code>start</code> into the <code>cdata</code> state. It remains there, applying the <code>text</code> token to any string it encounters. Finally, when it hits a closing <code>]></code> symbol, it returns to the <code>start</code> state and continues to tokenize anything else.</p>
|
||||
|
||||
5
node_modules/ace/kitchen-sink.html
generated
vendored
5
node_modules/ace/kitchen-sink.html
generated
vendored
@ -12,8 +12,8 @@
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
<!-- <script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
-->
|
||||
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
|
||||
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
@ -96,7 +96,6 @@
|
||||
<select id="keybinding" size="1">
|
||||
<option value="ace">Ace</option>
|
||||
<option value="vim">Vim</option>
|
||||
<option value="vim2">Vim2</option>
|
||||
<option value="emacs">Emacs</option>
|
||||
<option value="custom">Custom</option>
|
||||
</select>
|
||||
|
||||
3
node_modules/ace/lib/ace/autocomplete.js
generated
vendored
3
node_modules/ace/lib/ace/autocomplete.js
generated
vendored
@ -143,7 +143,7 @@ var Autocomplete = function() {
|
||||
// on IE preventDefault doesn't stop scrollbar from being focussed
|
||||
var el = document.activeElement;
|
||||
var text = this.editor.textInput.getElement()
|
||||
if (el != text && el.parentNode != this.popup.container
|
||||
if (el != text && ( !this.popup || el.parentNode != this.popup.container )
|
||||
&& el != this.tooltipNode && e.relatedTarget != this.tooltipNode
|
||||
&& e.relatedTarget != text
|
||||
) {
|
||||
@ -205,7 +205,6 @@ var Autocomplete = function() {
|
||||
"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) { return editor.completer.insertMatch(); },
|
||||
"Shift-Return": function(editor) { editor.completer.insertMatch(true); },
|
||||
"Tab": function(editor) {
|
||||
|
||||
8
node_modules/ace/lib/ace/autocomplete/popup.js
generated
vendored
8
node_modules/ace/lib/ace/autocomplete/popup.js
generated
vendored
@ -197,8 +197,12 @@ var AcePopup = function(parentNode) {
|
||||
|
||||
if (data.meta) {
|
||||
var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth;
|
||||
if (data.meta.length + data.caption.length < maxW - 2)
|
||||
tokens.push({type: "rightAlignedText", value: data.meta});
|
||||
var metaData = data.meta;
|
||||
if (metaData.length + data.caption.length > maxW - 2) {
|
||||
// trim meta to fit this popup and add ellipsis
|
||||
metaData = metaData.substr(0, maxW - data.caption.length - 3) + "\u2026"
|
||||
}
|
||||
tokens.push({type: "rightAlignedText", value: metaData});
|
||||
}
|
||||
return tokens;
|
||||
};
|
||||
|
||||
2
node_modules/ace/lib/ace/commands/default_commands.js
generated
vendored
2
node_modules/ace/lib/ace/commands/default_commands.js
generated
vendored
@ -123,7 +123,7 @@ exports.commands = [{
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "foldall",
|
||||
bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"),
|
||||
bindKey: bindKey(null, "Ctrl-Command-Option-0"),
|
||||
exec: function(editor) { editor.session.foldAll(); },
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
|
||||
3
node_modules/ace/lib/ace/css/editor.css
generated
vendored
3
node_modules/ace/lib/ace/css/editor.css
generated
vendored
@ -118,7 +118,6 @@
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
left: 0;
|
||||
top: auto!important;
|
||||
}
|
||||
|
||||
.ace_print-margin {
|
||||
@ -161,6 +160,8 @@
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
61
node_modules/ace/lib/ace/edit_session.js
generated
vendored
61
node_modules/ace/lib/ace/edit_session.js
generated
vendored
@ -1829,7 +1829,7 @@ var EditSession = function(text, mode) {
|
||||
TAB_SPACE = 12;
|
||||
|
||||
|
||||
this.$computeWrapSplits = function(tokens, wrapLimit) {
|
||||
this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) {
|
||||
if (tokens.length == 0) {
|
||||
return [];
|
||||
}
|
||||
@ -1840,6 +1840,31 @@ var EditSession = function(text, mode) {
|
||||
|
||||
var isCode = this.$wrapAsCode;
|
||||
|
||||
var indentedSoftWrap = this.$indentedSoftWrap;
|
||||
var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)
|
||||
|| indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);
|
||||
|
||||
function getWrapIndent() {
|
||||
var indentation = 0;
|
||||
if (maxIndent === 0)
|
||||
return indentation;
|
||||
if (indentedSoftWrap) {
|
||||
for (var i = 0; i < tokens.length; i++) {
|
||||
var token = tokens[i];
|
||||
if (token == SPACE)
|
||||
indentation += 1;
|
||||
else if (token == TAB)
|
||||
indentation += tabSize;
|
||||
else if (token == TAB_SPACE)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isCode && indentedSoftWrap !== false)
|
||||
indentation += tabSize;
|
||||
return Math.min(indentation, maxIndent);
|
||||
}
|
||||
function addSplit(screenPos) {
|
||||
var displayed = tokens.slice(lastSplit, screenPos);
|
||||
|
||||
@ -1856,14 +1881,18 @@ var EditSession = function(text, mode) {
|
||||
len -= 1;
|
||||
});
|
||||
|
||||
if (!splits.length) {
|
||||
indent = getWrapIndent();
|
||||
splits.indent = indent;
|
||||
}
|
||||
lastDocSplit += len;
|
||||
splits.push(lastDocSplit);
|
||||
lastSplit = screenPos;
|
||||
}
|
||||
|
||||
while (displayLength - lastSplit > wrapLimit) {
|
||||
var indent = 0;
|
||||
while (displayLength - lastSplit > wrapLimit - indent) {
|
||||
// This is, where the split should be.
|
||||
var split = lastSplit + wrapLimit;
|
||||
var split = lastSplit + wrapLimit - indent;
|
||||
|
||||
// If there is a space or tab at this split position, then making
|
||||
// a split is simple.
|
||||
@ -1923,7 +1952,7 @@ var EditSession = function(text, mode) {
|
||||
|
||||
// === ELSE ===
|
||||
// Search for the first non space/tab/placeholder/punctuation token backwards.
|
||||
var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1);
|
||||
var minSplit = Math.max(split - (wrapLimit -(wrapLimit>>2)), lastSplit - 1);
|
||||
while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
|
||||
split --;
|
||||
}
|
||||
@ -1951,7 +1980,7 @@ var EditSession = function(text, mode) {
|
||||
// around -> force a split.
|
||||
if (tokens[split] == CHAR_EXT)
|
||||
split--;
|
||||
addSplit(split);
|
||||
addSplit(split - indent);
|
||||
}
|
||||
return splits;
|
||||
};
|
||||
@ -2058,6 +2087,16 @@ var EditSession = function(text, mode) {
|
||||
}
|
||||
};
|
||||
|
||||
this.getRowWrapIndent = function(screenRow) {
|
||||
if (this.$useWrapMode) {
|
||||
var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
|
||||
var splits = this.$wrapData[pos.row];
|
||||
return splits.length && splits[0] < pos.column ? splits.indent : 0;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position (on screen) for the last character in the provided screen row.
|
||||
* @param {Number} screenRow The screen row to check
|
||||
@ -2195,20 +2234,21 @@ var EditSession = function(text, mode) {
|
||||
line = this.getLine(docRow);
|
||||
foldLine = null;
|
||||
}
|
||||
|
||||
var wrapIndent = 0;
|
||||
if (this.$useWrapMode) {
|
||||
var splits = this.$wrapData[docRow];
|
||||
if (splits) {
|
||||
var splitIndex = Math.floor(screenRow - row);
|
||||
column = splits[splitIndex];
|
||||
if(splitIndex > 0 && splits.length) {
|
||||
wrapIndent = splits.indent;
|
||||
docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
|
||||
line = line.substring(docColumn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
docColumn += this.$getStringScreenWidth(line, screenColumn)[1];
|
||||
docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];
|
||||
|
||||
// We remove one character at the end so that the docColumn
|
||||
// position returned is not associated to the next row on the screen.
|
||||
@ -2300,6 +2340,7 @@ var EditSession = function(text, mode) {
|
||||
textLine = this.getLine(docRow).substring(0, docColumn);
|
||||
foldStartRow = docRow;
|
||||
}
|
||||
var wrapIndent = 0;
|
||||
// Clamp textLine if in wrapMode.
|
||||
if (this.$useWrapMode) {
|
||||
var wrapRow = this.$wrapData[foldStartRow];
|
||||
@ -2312,12 +2353,13 @@ var EditSession = function(text, mode) {
|
||||
textLine = textLine.substring(
|
||||
wrapRow[screenRowOffset - 1] || 0, textLine.length
|
||||
);
|
||||
wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
row: screenRow,
|
||||
column: this.$getStringScreenWidth(textLine)[0]
|
||||
column: wrapIndent + this.$getStringScreenWidth(textLine)[0]
|
||||
};
|
||||
};
|
||||
|
||||
@ -2519,6 +2561,7 @@ config.defineOptions(EditSession.prototype, "session", {
|
||||
},
|
||||
initialValue: "auto"
|
||||
},
|
||||
indentedSoftWrap: { initialValue: true },
|
||||
firstLineNumber: {
|
||||
set: function() {this._signal("changeBreakpoint");},
|
||||
initialValue: 1
|
||||
|
||||
20
node_modules/ace/lib/ace/edit_session_test.js
generated
vendored
20
node_modules/ace/lib/ace/edit_session_test.js
generated
vendored
@ -280,7 +280,7 @@ module.exports = {
|
||||
session.setUseWrapMode(true);
|
||||
session.setWrapLimitRange(12, 12);
|
||||
session.adjustWrapLimit(80);
|
||||
|
||||
session.setOption("wrapMethod", "text");
|
||||
assert.position(session.documentToScreenPosition(0, 11), 0, 11);
|
||||
assert.position(session.documentToScreenPosition(0, 12), 1, 0);
|
||||
},
|
||||
@ -380,7 +380,8 @@ module.exports = {
|
||||
line = lang.stringTrimRight(line);
|
||||
var tokens = EditSession.prototype.$getDisplayTokens(line);
|
||||
var splits = EditSession.prototype.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
// console.log("String:", line, "Result:", splits, "Expected:", assertEqual);
|
||||
console.log("String:", line, "Result:", splits, "Expected:", assertEqual);
|
||||
|
||||
assert.ok(splits.length == assertEqual.length);
|
||||
for (var i = 0; i < splits.length; i++) {
|
||||
assert.ok(splits[i] == assertEqual[i]);
|
||||
@ -388,6 +389,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
EditSession.prototype.$wrapAsCode = true;
|
||||
EditSession.prototype.$indentedSoftWrap = false;
|
||||
// Basic splitting.
|
||||
computeAndAssert("foo bar foo bar", [ 12 ]);
|
||||
computeAndAssert("foo bar f bar", [ 12 ]);
|
||||
@ -413,16 +415,26 @@ module.exports = {
|
||||
computeAndAssert("ぁぁ", [1], 2);
|
||||
computeAndAssert(" ぁぁ", [1, 2], 2);
|
||||
computeAndAssert(" ぁ\tぁ", [1, 3], 2);
|
||||
computeAndAssert(" ぁぁ\tぁ", [1, 4], 4);
|
||||
computeAndAssert(" ぁぁ\tぁ", [2, 4], 4);
|
||||
computeAndAssert("ぁぁ ぁぁ\tぁ", [3, 6], 6);
|
||||
|
||||
// Test wrapping for punctuation.
|
||||
computeAndAssert(" ab.c;ef++", [1, 3, 5, 7, 8], 2);
|
||||
computeAndAssert(" ab.c;ef++", [2, 4, 6, 8], 2);
|
||||
computeAndAssert(" ab.c;ef++", [3, 5, 8], 3);
|
||||
computeAndAssert(" a.b", [1, 2, 3], 1);
|
||||
computeAndAssert("#>>", [1, 2], 1);
|
||||
|
||||
// Test wrapping for punctuation in
|
||||
EditSession.prototype.$wrapAsCode = false;
|
||||
computeAndAssert("ab cde, Juhu kinners", [3, 8, 13, 19], 6);
|
||||
|
||||
// test indented wrapping
|
||||
EditSession.prototype.$indentedSoftWrap = true;
|
||||
computeAndAssert("foo bar foo bar foo bara foo", [12, 25]);
|
||||
computeAndAssert("fooooooooooooooooooooooooooo", [12, 24]);
|
||||
computeAndAssert("\t\tfoo bar fooooooooooobooooooo", [6, 10, 16, 22, 28]);
|
||||
computeAndAssert("\t\t\tfoo bar fooooooooooobooooooo", [3, 7, 11, 17, 23, 29]);
|
||||
computeAndAssert("\tfoo \t \t \t \t bar", [6, 12]); // 14
|
||||
},
|
||||
|
||||
"test get longest line" : function() {
|
||||
|
||||
1
node_modules/ace/lib/ace/editor.js
generated
vendored
1
node_modules/ace/lib/ace/editor.js
generated
vendored
@ -2658,6 +2658,7 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||
useSoftTabs: "session",
|
||||
tabSize: "session",
|
||||
wrap: "session",
|
||||
indentedSoftWrap: "session",
|
||||
foldStyle: "session",
|
||||
mode: "session"
|
||||
});
|
||||
|
||||
2
node_modules/ace/lib/ace/ext/menu_tools/generate_settings_menu.js
generated
vendored
2
node_modules/ace/lib/ace/ext/menu_tools/generate_settings_menu.js
generated
vendored
@ -93,7 +93,7 @@ module.exports.generateSettingsMenu = function generateSettingsMenu (editor) {
|
||||
});
|
||||
|
||||
var el = topmenu.appendChild(document.createElement('div'));
|
||||
var version = "1.1.8";
|
||||
var version = "1.1.9";
|
||||
el.style.padding = "1em";
|
||||
el.textContent = "Ace version " + version;
|
||||
|
||||
|
||||
11
node_modules/ace/lib/ace/ext/modelist.js
generated
vendored
11
node_modules/ace/lib/ace/ext/modelist.js
generated
vendored
@ -47,7 +47,7 @@ var supportedModes = {
|
||||
ActionScript:["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
||||
AsciiDoc: ["asciidoc"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
Assembly_x86:["asm"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
@ -99,6 +99,7 @@ var supportedModes = {
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
Lean: ["lean|hlean"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
@ -145,6 +146,7 @@ var supportedModes = {
|
||||
Soy_Template:["soy"],
|
||||
Space: ["space"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Tcl: ["tcl"],
|
||||
@ -159,9 +161,11 @@ var supportedModes = {
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"]
|
||||
YAML: ["yaml|yml"],
|
||||
// Add the missing mode "Django" to ext-modelist
|
||||
Django: ["html"]
|
||||
};
|
||||
|
||||
var nameOverrides = {
|
||||
@ -190,4 +194,3 @@ module.exports = {
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
27
node_modules/ace/lib/ace/ext/static.css
generated
vendored
27
node_modules/ace/lib/ace/ext/static.css
generated
vendored
@ -1,24 +1,31 @@
|
||||
.ace_static_highlight {
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;
|
||||
font-size: 12px;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;
|
||||
font-size: 12px;
|
||||
white-space: pre-wrap
|
||||
}
|
||||
|
||||
.ace_static_highlight .ace_gutter {
|
||||
width: 25px !important;
|
||||
float: left;
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 0 3px 0 0;
|
||||
margin-right: 3px;
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.ace_static_highlight .ace_line { clear: both; }
|
||||
.ace_static_highlight.ace_show_gutter .ace_line {
|
||||
padding-left: 2.6em;
|
||||
}
|
||||
|
||||
.ace_static_highlight .ace_line { position: relative; }
|
||||
|
||||
.ace_static_highlight .ace_gutter-cell {
|
||||
-moz-user-select: -moz-none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
-moz-user-select: -moz-none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
|
||||
3
node_modules/ace/lib/ace/ext/static_highlight.js
generated
vendored
3
node_modules/ace/lib/ace/ext/static_highlight.js
generated
vendored
@ -171,7 +171,8 @@ highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) {
|
||||
|
||||
// let's prepare the whole html
|
||||
var html = "<div class='" + theme.cssClass + "'>" +
|
||||
"<div class='ace_static_highlight' style='counter-reset:ace_line " + (lineStart - 1) + "'>" +
|
||||
"<div class='ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter") +
|
||||
"' style='counter-reset:ace_line " + (lineStart - 1) + "'>" +
|
||||
stringBuilder.join("") +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
|
||||
8
node_modules/ace/lib/ace/ext/static_highlight_test.js
generated
vendored
8
node_modules/ace/lib/ace/ext/static_highlight_test.js
generated
vendored
@ -28,12 +28,12 @@ module.exports = {
|
||||
var mode = new JavaScriptMode();
|
||||
|
||||
var result = highlighter.render(snippet, mode, theme);
|
||||
assert.equal(result.html, "<div class='ace-tomorrow'><div class='ace_static_highlight' style='counter-reset:ace_line 0'>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_comment ace_doc'>/**\xa0this\xa0is\xa0a\xa0function</span>\n</div>"
|
||||
assert.equal(result.html, "<div class='ace-tomorrow'><div class='ace_static_highlight ace_show_gutter' style='counter-reset:ace_line 0'>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_comment ace_doc'>/** this is a function</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_comment ace_doc'>*</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_comment ace_doc'>*/</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_storage ace_type'>function</span>\xa0<span class='ace_entity ace_name ace_function'>hello</span>\xa0<span class='ace_paren ace_lparen'>(</span><span class='ace_variable ace_parameter'>a</span><span class='ace_punctuation ace_operator'>,\xa0</span><span class='ace_variable ace_parameter'>b</span><span class='ace_punctuation ace_operator'>,\xa0</span><span class='ace_variable ace_parameter'>c</span><span class='ace_paren ace_rparen'>)</span>\xa0<span class='ace_paren ace_lparen'>{</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span>\xa0\xa0\xa0\xa0<span class='ace_storage ace_type'>console</span><span class='ace_punctuation ace_operator'>.</span><span class='ace_support ace_function ace_firebug'>log</span><span class='ace_paren ace_lparen'>(</span><span class='ace_identifier'>a</span>\xa0<span class='ace_keyword ace_operator'>*</span>\xa0<span class='ace_identifier'>b</span>\xa0<span class='ace_keyword ace_operator'>+</span>\xa0<span class='ace_identifier'>c</span>\xa0<span class='ace_keyword ace_operator'>+</span>\xa0<span class='ace_string'>'sup$'</span><span class='ace_paren ace_rparen'>)</span><span class='ace_punctuation ace_operator'>;</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_storage ace_type'>function</span> <span class='ace_entity ace_name ace_function'>hello</span> <span class='ace_paren ace_lparen'>(</span><span class='ace_variable ace_parameter'>a</span><span class='ace_punctuation ace_operator'>, </span><span class='ace_variable ace_parameter'>b</span><span class='ace_punctuation ace_operator'>, </span><span class='ace_variable ace_parameter'>c</span><span class='ace_paren ace_rparen'>)</span> <span class='ace_paren ace_lparen'>{</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span> <span class='ace_storage ace_type'>console</span><span class='ace_punctuation ace_operator'>.</span><span class='ace_support ace_function ace_firebug'>log</span><span class='ace_paren ace_lparen'>(</span><span class='ace_identifier'>a</span> <span class='ace_keyword ace_operator'>*</span> <span class='ace_identifier'>b</span> <span class='ace_keyword ace_operator'>+</span> <span class='ace_identifier'>c</span> <span class='ace_keyword ace_operator'>+</span> <span class='ace_string'>'sup$'</span><span class='ace_paren ace_rparen'>)</span><span class='ace_punctuation ace_operator'>;</span>\n</div>"
|
||||
+ "<div class='ace_line'><span class='ace_gutter ace_gutter-cell' unselectable='on'></span><span class='ace_paren ace_rparen'>}</span>\n</div>"
|
||||
+ "</div></div>");
|
||||
assert.ok(!!result.css);
|
||||
|
||||
2
node_modules/ace/lib/ace/ext/themelist.js
generated
vendored
2
node_modules/ace/lib/ace/ext/themelist.js
generated
vendored
@ -51,12 +51,14 @@ var themeData = [
|
||||
["Dreamweaver" ],
|
||||
["Eclipse" ],
|
||||
["GitHub" ],
|
||||
["IPlastic" ],
|
||||
["Solarized Light"],
|
||||
["TextMate" ],
|
||||
["Tomorrow" ],
|
||||
["XCode" ],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server" ,"sqlserver" , "light"],
|
||||
["Ambiance" ,"ambiance" , "dark"],
|
||||
["Chaos" ,"chaos" , "dark"],
|
||||
["Clouds Midnight" ,"clouds_midnight" , "dark"],
|
||||
|
||||
5
node_modules/ace/lib/ace/keyboard/textinput.js
generated
vendored
5
node_modules/ace/lib/ace/keyboard/textinput.js
generated
vendored
@ -51,7 +51,7 @@ var TextInput = function(parentNode, host) {
|
||||
text.setAttribute("spellcheck", false);
|
||||
|
||||
text.style.opacity = "0";
|
||||
if (useragent.isOldIE) text.style.top = "-100px";
|
||||
if (useragent.isOldIE) text.style.top = "-1000px";
|
||||
parentNode.insertBefore(text, parentNode.firstChild);
|
||||
|
||||
var PLACEHOLDER = "\x01\x01";
|
||||
@ -76,8 +76,9 @@ var TextInput = function(parentNode, host) {
|
||||
resetSelection();
|
||||
});
|
||||
this.focus = function() {
|
||||
if (tempStyle) return text.focus();
|
||||
text.style.position = "fixed";
|
||||
text.style.top = "-10000000px";
|
||||
text.style.top = "-1000px";
|
||||
text.focus();
|
||||
setTimeout(function() {
|
||||
text.style.position = "";
|
||||
|
||||
318
node_modules/ace/lib/ace/keyboard/vim.js
generated
vendored
318
node_modules/ace/lib/ace/keyboard/vim.js
generated
vendored
@ -96,7 +96,7 @@ define(function(require, exports, module) {
|
||||
var useragent = require("../lib/useragent");
|
||||
var SearchHighlight = require("../search_highlight").SearchHighlight;
|
||||
var multiSelectCommands = require("../commands/multi_select_commands");
|
||||
var TextModeTokenRe = require("ace/mode/text").Mode.prototype.tokenRe;
|
||||
var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe;
|
||||
require("../multi_select");
|
||||
|
||||
var CodeMirror = function(ace) {
|
||||
@ -653,6 +653,9 @@ define(function(require, exports, module) {
|
||||
this.refresh = function() {
|
||||
return this.ace.resize(true);
|
||||
};
|
||||
this.getMode = function() {
|
||||
return { name : this.getOption("mode") };
|
||||
}
|
||||
}).call(CodeMirror.prototype);
|
||||
function toAcePos(cmPos) {
|
||||
return {row: cmPos.line, column: cmPos.ch};
|
||||
@ -1135,9 +1138,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
|
||||
var numberRegex = /[\d]/;
|
||||
var wordRegexp = [{test: CodeMirror.isWordChar}, {test: function(ch) {
|
||||
return !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
|
||||
}}], bigWordRegexp = [(/\S/)];
|
||||
var wordCharTest = [CodeMirror.isWordChar, function(ch) {
|
||||
return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
|
||||
}], bigWordCharTest = [function(ch) {
|
||||
return /\S/.test(ch);
|
||||
}];
|
||||
function makeKeyRange(start, size) {
|
||||
var keys = [];
|
||||
for (var i = start; i < start + size; i++) {
|
||||
@ -1179,23 +1184,30 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
|
||||
var options = {};
|
||||
function defineOption(name, defaultValue, type) {
|
||||
if (defaultValue === undefined) { throw Error('defaultValue is required'); }
|
||||
function defineOption(name, defaultValue, type, aliases, callback) {
|
||||
if (defaultValue === undefined && !callback) {
|
||||
throw Error('defaultValue is required unless callback is provided');
|
||||
}
|
||||
if (!type) { type = 'string'; }
|
||||
var opt = name;
|
||||
if (typeof name == "string")
|
||||
opt = {
|
||||
type: type,
|
||||
defaultValue: defaultValue
|
||||
};
|
||||
else
|
||||
name = opt.name;
|
||||
options[name] = opt;
|
||||
setOption(name, defaultValue);
|
||||
options[name] = {
|
||||
type: type,
|
||||
defaultValue: defaultValue,
|
||||
callback: callback
|
||||
};
|
||||
if (aliases) {
|
||||
for (var i = 0; i < aliases.length; i++) {
|
||||
options[aliases[i]] = options[name];
|
||||
}
|
||||
}
|
||||
if (defaultValue) {
|
||||
setOption(name, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
function setOption(name, value, cm) {
|
||||
function setOption(name, value, cm, cfg) {
|
||||
var option = options[name];
|
||||
cfg = cfg || {};
|
||||
var scope = cfg.scope;
|
||||
if (!option) {
|
||||
throw Error('Unknown option: ' + name);
|
||||
}
|
||||
@ -1207,18 +1219,60 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
value = true;
|
||||
}
|
||||
}
|
||||
option.value = value;
|
||||
if (option.set) option.set(value, cm);
|
||||
if (option.callback) {
|
||||
if (scope !== 'local') {
|
||||
option.callback(value, undefined);
|
||||
}
|
||||
if (scope !== 'global' && cm) {
|
||||
option.callback(value, cm);
|
||||
}
|
||||
} else {
|
||||
if (scope !== 'local') {
|
||||
option.value = option.type == 'boolean' ? !!value : value;
|
||||
}
|
||||
if (scope !== 'global' && cm) {
|
||||
cm.state.vim.options[name] = {value: value};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getOption(name) {
|
||||
function getOption(name, cm, cfg) {
|
||||
var option = options[name];
|
||||
cfg = cfg || {};
|
||||
var scope = cfg.scope;
|
||||
if (!option) {
|
||||
throw Error('Unknown option: ' + name);
|
||||
}
|
||||
return option.value;
|
||||
if (option.callback) {
|
||||
var local = cm && option.callback(undefined, cm);
|
||||
if (scope !== 'global' && local !== undefined) {
|
||||
return local;
|
||||
}
|
||||
if (scope !== 'local') {
|
||||
return option.callback();
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
|
||||
return (local || (scope !== 'local') && option || {}).value;
|
||||
}
|
||||
}
|
||||
|
||||
defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) {
|
||||
// Option is local. Do nothing for global.
|
||||
if (cm === undefined) {
|
||||
return;
|
||||
}
|
||||
// The 'filetype' option proxies to the CodeMirror 'mode' option.
|
||||
if (name === undefined) {
|
||||
var mode = cm.getMode().name;
|
||||
return mode == 'null' ? '' : mode;
|
||||
} else {
|
||||
var mode = name == '' ? 'null' : name;
|
||||
cm.setOption('mode', mode);
|
||||
}
|
||||
});
|
||||
|
||||
var createCircularJumpList = function() {
|
||||
var size = 100;
|
||||
var pointer = -1;
|
||||
@ -1371,8 +1425,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
visualBlock: false,
|
||||
lastSelection: null,
|
||||
lastPastedText: null,
|
||||
sel: {
|
||||
}
|
||||
sel: {},
|
||||
// Buffer-local/window-local values of vim options.
|
||||
options: {}
|
||||
};
|
||||
}
|
||||
return cm.state.vim;
|
||||
@ -1423,6 +1478,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
// Testing hook.
|
||||
maybeInitVimState_: maybeInitVimState,
|
||||
|
||||
suppressErrorLogging: false,
|
||||
|
||||
InsertModeKey: InsertModeKey,
|
||||
map: function(lhs, rhs, ctx) {
|
||||
// Add user defined key bindings.
|
||||
@ -1432,6 +1489,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
// remove user defined key bindings.
|
||||
exCommandDispatcher.unmap(lhs, ctx);
|
||||
},
|
||||
// TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace
|
||||
// them, or somehow make them work with the existing CodeMirror setOption/getOption API.
|
||||
setOption: setOption,
|
||||
getOption: getOption,
|
||||
defineOption: defineOption,
|
||||
@ -1573,7 +1632,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
// clear VIM state in case it's in a bad state.
|
||||
cm.state.vim = undefined;
|
||||
maybeInitVimState(cm);
|
||||
console['log'](e);
|
||||
if (!CodeMirror.Vim.suppressErrorLogging) {
|
||||
console['log'](e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return true;
|
||||
@ -1583,7 +1644,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
},
|
||||
handleEx: function(cm, input) {
|
||||
exCommandDispatcher.processCommand(cm, input);
|
||||
}
|
||||
},
|
||||
|
||||
defineMotion: defineMotion,
|
||||
defineAction: defineAction,
|
||||
defineOperator: defineOperator,
|
||||
mapCommand: mapCommand,
|
||||
_mapCommand: _mapCommand,
|
||||
|
||||
exitVisualMode: exitVisualMode,
|
||||
exitInsertMode: exitInsertMode
|
||||
};
|
||||
|
||||
// Represents the current input state.
|
||||
@ -1833,12 +1903,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
break;
|
||||
case 'search':
|
||||
this.processSearch(cm, vim, command);
|
||||
clearInputState(cm);
|
||||
break;
|
||||
case 'ex':
|
||||
case 'keyToEx':
|
||||
this.processEx(cm, vim, command);
|
||||
clearInputState(cm);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1934,6 +2002,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
updateSearchQuery(cm, query, ignoreCase, smartCase);
|
||||
} catch (e) {
|
||||
showConfirm(cm, 'Invalid regex: ' + query);
|
||||
clearInputState(cm);
|
||||
return;
|
||||
}
|
||||
commandDispatcher.processMotion(cm, vim, {
|
||||
@ -2095,8 +2164,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var registerName = inputState.registerName;
|
||||
var sel = vim.sel;
|
||||
// TODO: Make sure cm and vim selections are identical outside visual mode.
|
||||
var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head'));
|
||||
var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor'));
|
||||
var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head'));
|
||||
var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor'));
|
||||
var oldHead = copyCursor(origHead);
|
||||
var oldAnchor = copyCursor(origAnchor);
|
||||
var newHead, newAnchor;
|
||||
@ -2271,7 +2340,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var operatorMoveTo = operators[operator](
|
||||
cm, operatorArgs, cmSel.ranges, oldAnchor, newHead);
|
||||
if (vim.visualMode) {
|
||||
exitVisualMode(cm);
|
||||
exitVisualMode(cm, operatorMoveTo != null);
|
||||
}
|
||||
if (operatorMoveTo) {
|
||||
cm.setCursor(operatorMoveTo);
|
||||
@ -2648,6 +2717,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
};
|
||||
|
||||
function defineMotion(name, fn) {
|
||||
motions[name] = fn;
|
||||
}
|
||||
|
||||
function fillArray(val, times) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < times; i++) {
|
||||
@ -2669,10 +2742,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var anchor = ranges[0].anchor,
|
||||
head = ranges[0].head;
|
||||
text = cm.getRange(anchor, head);
|
||||
if (!isWhiteSpaceString(text)) {
|
||||
var lastState = vim.lastEditInputState || {};
|
||||
if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) {
|
||||
// Exclude trailing whitespace if the range is not all whitespace.
|
||||
var match = (/\s+$/).exec(text);
|
||||
if (match) {
|
||||
if (match && lastState.motionArgs && lastState.motionArgs.forward) {
|
||||
head = offsetCursor(head, 0, - match[0].length);
|
||||
text = text.slice(0, - match[0].length);
|
||||
}
|
||||
@ -2730,7 +2804,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
vimGlobalState.registerController.pushText(
|
||||
args.registerName, 'delete', text,
|
||||
args.linewise, vim.visualBlock);
|
||||
return finalHead;
|
||||
return clipCursorToContent(cm, finalHead);
|
||||
},
|
||||
indent: function(cm, args, ranges) {
|
||||
var vim = cm.state.vim;
|
||||
@ -2798,6 +2872,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
};
|
||||
|
||||
function defineOperator(name, fn) {
|
||||
operators[name] = fn;
|
||||
}
|
||||
|
||||
var actions = {
|
||||
jumpListWalk: function(cm, actionArgs, vim) {
|
||||
if (vim.visualMode) {
|
||||
@ -3015,6 +3093,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
if (vim.visualMode) {
|
||||
curStart = cm.getCursor('anchor');
|
||||
curEnd = cm.getCursor('head');
|
||||
if (cursorIsBefore(curEnd, curStart)) {
|
||||
var tmp = curEnd;
|
||||
curEnd = curStart;
|
||||
curStart = tmp;
|
||||
}
|
||||
curEnd.ch = lineLength(cm, curEnd.line) - 1;
|
||||
} else {
|
||||
// Repeat is the number of lines to join. Minimum 2 lines.
|
||||
@ -3033,10 +3116,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
cm.replaceRange(text, curStart, tmp);
|
||||
}
|
||||
var curFinalPos = Pos(curStart.line, finalCh);
|
||||
cm.setCursor(curFinalPos);
|
||||
if (vim.visualMode) {
|
||||
exitVisualMode(cm);
|
||||
exitVisualMode(cm, false);
|
||||
}
|
||||
cm.setCursor(curFinalPos);
|
||||
},
|
||||
newLineAndEnterInsertMode: function(cm, actionArgs, vim) {
|
||||
vim.insertMode = true;
|
||||
@ -3199,7 +3282,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
}
|
||||
if (vim.visualMode) {
|
||||
exitVisualMode(cm);
|
||||
exitVisualMode(cm, false);
|
||||
}
|
||||
cm.setCursor(curPosFinal);
|
||||
},
|
||||
@ -3257,7 +3340,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ?
|
||||
selections[0].anchor : selections[0].head;
|
||||
cm.setCursor(curStart);
|
||||
exitVisualMode(cm);
|
||||
exitVisualMode(cm, false);
|
||||
} else {
|
||||
cm.setCursor(offsetCursor(curEnd, 0, -1));
|
||||
}
|
||||
@ -3305,6 +3388,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
exitInsertMode: exitInsertMode
|
||||
};
|
||||
|
||||
function defineAction(name, fn) {
|
||||
actions[name] = fn;
|
||||
}
|
||||
|
||||
/*
|
||||
* Below are miscellaneous utility functions used by vim.js
|
||||
*/
|
||||
@ -3434,9 +3521,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
function lineLength(cm, lineNum) {
|
||||
return cm.getLine(lineNum).length;
|
||||
}
|
||||
function reverse(s){
|
||||
return s.split('').reverse().join('');
|
||||
}
|
||||
function trim(s) {
|
||||
if (s.trim) {
|
||||
return s.trim();
|
||||
@ -3750,59 +3834,38 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
|
||||
// Seek to first word or non-whitespace character, depending on if
|
||||
// noSymbol is true.
|
||||
var textAfterIdx = line.substring(idx);
|
||||
var firstMatchedChar;
|
||||
if (noSymbol) {
|
||||
firstMatchedChar = textAfterIdx.search(/\w/);
|
||||
} else {
|
||||
firstMatchedChar = textAfterIdx.search(/\S/);
|
||||
var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0];
|
||||
while (!test(line.charAt(idx))) {
|
||||
idx++;
|
||||
if (idx >= line.length) { return null; }
|
||||
}
|
||||
if (firstMatchedChar == -1) {
|
||||
return null;
|
||||
}
|
||||
idx += firstMatchedChar;
|
||||
textAfterIdx = line.substring(idx);
|
||||
var textBeforeIdx = line.substring(0, idx);
|
||||
|
||||
var matchRegex;
|
||||
// Greedy matchers for the "word" we are trying to expand.
|
||||
if (bigWord) {
|
||||
matchRegex = /^\S+/;
|
||||
test = bigWordCharTest[0];
|
||||
} else {
|
||||
if ((/\w/).test(line.charAt(idx))) {
|
||||
matchRegex = /^\w+/;
|
||||
} else {
|
||||
matchRegex = /^[^\w\s]+/;
|
||||
test = wordCharTest[0];
|
||||
if (!test(line.charAt(idx))) {
|
||||
test = wordCharTest[1];
|
||||
}
|
||||
}
|
||||
|
||||
var wordAfterRegex = matchRegex.exec(textAfterIdx);
|
||||
var wordStart = idx;
|
||||
var wordEnd = idx + wordAfterRegex[0].length;
|
||||
// TODO: Find a better way to do this. It will be slow on very long lines.
|
||||
var revTextBeforeIdx = reverse(textBeforeIdx);
|
||||
var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx);
|
||||
if (wordBeforeRegex) {
|
||||
wordStart -= wordBeforeRegex[0].length;
|
||||
}
|
||||
var end = idx, start = idx;
|
||||
while (test(line.charAt(end)) && end < line.length) { end++; }
|
||||
while (test(line.charAt(start)) && start >= 0) { start--; }
|
||||
start++;
|
||||
|
||||
if (inclusive) {
|
||||
// If present, trim all whitespace after word.
|
||||
// Otherwise, trim all whitespace before word.
|
||||
var textAfterWordEnd = line.substring(wordEnd);
|
||||
var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length;
|
||||
if (whitespacesAfterWord > 0) {
|
||||
wordEnd += whitespacesAfterWord;
|
||||
} else {
|
||||
var revTrim = revTextBeforeIdx.length - wordStart;
|
||||
var textBeforeWordStart = revTextBeforeIdx.substring(revTrim);
|
||||
var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length;
|
||||
wordStart -= whitespacesBeforeWord;
|
||||
// If present, include all whitespace after word.
|
||||
// Otherwise, include all whitespace before word, except indentation.
|
||||
var wordEnd = end;
|
||||
while (/\s/.test(line.charAt(end)) && end < line.length) { end++; }
|
||||
if (wordEnd == end) {
|
||||
var wordStart = start;
|
||||
while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; }
|
||||
if (!start) { start = wordStart; }
|
||||
}
|
||||
}
|
||||
|
||||
return { start: Pos(cur.line, wordStart),
|
||||
end: Pos(cur.line, wordEnd) };
|
||||
return { start: Pos(cur.line, start), end: Pos(cur.line, end) };
|
||||
}
|
||||
|
||||
function recordJumpPosition(cm, oldCur, newCur) {
|
||||
@ -3960,7 +4023,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var pos = cur.ch;
|
||||
var line = cm.getLine(lineNum);
|
||||
var dir = forward ? 1 : -1;
|
||||
var regexps = bigWord ? bigWordRegexp : wordRegexp;
|
||||
var charTests = bigWord ? bigWordCharTest: wordCharTest;
|
||||
|
||||
if (emptyLineIsWord && line == '') {
|
||||
lineNum += dir;
|
||||
@ -3980,11 +4043,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
// Find bounds of next word.
|
||||
while (pos != stop) {
|
||||
var foundWord = false;
|
||||
for (var i = 0; i < regexps.length && !foundWord; ++i) {
|
||||
if (regexps[i].test(line.charAt(pos))) {
|
||||
for (var i = 0; i < charTests.length && !foundWord; ++i) {
|
||||
if (charTests[i](line.charAt(pos))) {
|
||||
wordStart = pos;
|
||||
// Advance to end of word.
|
||||
while (pos != stop && regexps[i].test(line.charAt(pos))) {
|
||||
while (pos != stop && charTests[i](line.charAt(pos))) {
|
||||
pos += dir;
|
||||
}
|
||||
wordEnd = pos;
|
||||
@ -4301,6 +4364,12 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
},
|
||||
setReversed: function(reversed) {
|
||||
vimGlobalState.isReversed = reversed;
|
||||
},
|
||||
getScrollbarAnnotate: function() {
|
||||
return this.annotate;
|
||||
},
|
||||
setScrollbarAnnotate: function(annotate) {
|
||||
this.annotate = annotate;
|
||||
}
|
||||
};
|
||||
function getSearchState(cm) {
|
||||
@ -4642,6 +4711,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
// pair of commands that have a shared prefix, at least one of their
|
||||
// shortNames must not match the prefix of the other command.
|
||||
var defaultExCommandMap = [
|
||||
{ name: 'colorscheme', shortName: 'colo' },
|
||||
{ name: 'map' },
|
||||
{ name: 'imap', shortName: 'im' },
|
||||
{ name: 'nmap', shortName: 'nm' },
|
||||
@ -4650,7 +4720,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
{ name: 'write', shortName: 'w' },
|
||||
{ name: 'undo', shortName: 'u' },
|
||||
{ name: 'redo', shortName: 'red' },
|
||||
{ name: 'set', shortName: 'set' },
|
||||
{ name: 'set', shortName: 'se' },
|
||||
{ name: 'set', shortName: 'se' },
|
||||
{ name: 'setlocal', shortName: 'setl' },
|
||||
{ name: 'setglobal', shortName: 'setg' },
|
||||
{ name: 'sort', shortName: 'sor' },
|
||||
{ name: 'substitute', shortName: 's', possiblyAsync: true },
|
||||
{ name: 'nohlsearch', shortName: 'noh' },
|
||||
@ -4663,6 +4736,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
};
|
||||
ExCommandDispatcher.prototype = {
|
||||
processCommand: function(cm, input, opt_params) {
|
||||
var that = this;
|
||||
cm.operation(function () {
|
||||
cm.curOp.isVimOp = true;
|
||||
that._processCommand(cm, input, opt_params);
|
||||
});
|
||||
},
|
||||
_processCommand: function(cm, input, opt_params) {
|
||||
var vim = cm.state.vim;
|
||||
var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');
|
||||
var previousCommand = commandHistoryRegister.toString();
|
||||
@ -4875,6 +4955,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
};
|
||||
|
||||
var exCommands = {
|
||||
colorscheme: function(cm, params) {
|
||||
if (!params.args || params.args.length < 1) {
|
||||
showConfirm(cm, cm.getOption('theme'));
|
||||
return;
|
||||
}
|
||||
cm.setOption('theme', params.args[0]);
|
||||
},
|
||||
map: function(cm, params, ctx) {
|
||||
var mapArgs = params.args;
|
||||
if (!mapArgs || mapArgs.length < 2) {
|
||||
@ -4908,6 +4995,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
},
|
||||
set: function(cm, params) {
|
||||
var setArgs = params.args;
|
||||
// Options passed through to the setOption/getOption calls. May be passed in by the
|
||||
// local/global versions of the set command
|
||||
var setCfg = params.setCfg || {};
|
||||
if (!setArgs || setArgs.length < 1) {
|
||||
if (cm) {
|
||||
showConfirm(cm, 'Invalid mapping: ' + params.input);
|
||||
@ -4931,24 +5021,35 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
optionName = optionName.substring(2);
|
||||
value = false;
|
||||
}
|
||||
|
||||
var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';
|
||||
if (optionIsBoolean && value == undefined) {
|
||||
// Calling set with a boolean option sets it to true.
|
||||
value = true;
|
||||
}
|
||||
if (!optionIsBoolean && !value || forceGet) {
|
||||
var oldValue = getOption(optionName);
|
||||
// If no value is provided, then we assume this is a get.
|
||||
// If no value is provided, then we assume this is a get.
|
||||
if (!optionIsBoolean && value === undefined || forceGet) {
|
||||
var oldValue = getOption(optionName, cm, setCfg);
|
||||
if (oldValue === true || oldValue === false) {
|
||||
showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
|
||||
} else {
|
||||
showConfirm(cm, ' ' + optionName + '=' + oldValue);
|
||||
}
|
||||
} else {
|
||||
setOption(optionName, value, cm);
|
||||
setOption(optionName, value, cm, setCfg);
|
||||
}
|
||||
},
|
||||
registers: function(cm,params) {
|
||||
setlocal: function (cm, params) {
|
||||
// setCfg is passed through to setOption
|
||||
params.setCfg = {scope: 'local'};
|
||||
this.set(cm, params);
|
||||
},
|
||||
setglobal: function (cm, params) {
|
||||
// setCfg is passed through to setOption
|
||||
params.setCfg = {scope: 'global'};
|
||||
this.set(cm, params);
|
||||
},
|
||||
registers: function(cm, params) {
|
||||
var regArgs = params.args;
|
||||
var registers = vimGlobalState.registerController.registers;
|
||||
var regInfo = '----------Registers----------<br><br>';
|
||||
@ -5428,6 +5529,19 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
}
|
||||
|
||||
function _mapCommand(command) {
|
||||
defaultKeymap.push(command);
|
||||
}
|
||||
|
||||
function mapCommand(keys, type, name, args, extra) {
|
||||
var command = {keys: keys, type: type};
|
||||
command[type] = name;
|
||||
command[type + "Args"] = args;
|
||||
for (var key in extra)
|
||||
command[key] = extra[key];
|
||||
_mapCommand(command);
|
||||
}
|
||||
|
||||
// The timeout in milliseconds for the two-character ESC keymap should be
|
||||
// adjusted according to your typing speed to prevent false positives.
|
||||
defineOption('insertModeEscKeysTimeout', 200, 'number');
|
||||
@ -5557,7 +5671,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}
|
||||
function updateFakeCursor(cm) {
|
||||
var vim = cm.state.vim;
|
||||
var from = copyCursor(vim.sel.head);
|
||||
var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
|
||||
var to = offsetCursor(from, 0, 1);
|
||||
if (vim.fakeCursor) {
|
||||
vim.fakeCursor.clear();
|
||||
@ -5568,7 +5682,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var anchor = cm.getCursor('anchor');
|
||||
var head = cm.getCursor('head');
|
||||
// Enter or exit visual mode to match mouse selection.
|
||||
if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) {
|
||||
if (vim.visualMode && !cm.somethingSelected()) {
|
||||
exitVisualMode(cm, false);
|
||||
} else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) {
|
||||
vim.visualMode = true;
|
||||
@ -5608,6 +5722,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
var macroModeState = vimGlobalState.macroModeState;
|
||||
var lastChange = macroModeState.lastInsertModeChanges;
|
||||
var keyName = CodeMirror.keyName(e);
|
||||
if (!keyName) { return; }
|
||||
function onKeyFound() {
|
||||
lastChange.changes.push(new InsertModeKey(keyName));
|
||||
return true;
|
||||
@ -5801,7 +5916,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
}, true);
|
||||
}
|
||||
return isHandled;
|
||||
}
|
||||
};
|
||||
exports.CodeMirror = CodeMirror;
|
||||
var getVim = Vim.maybeInitVimState_;
|
||||
exports.handler = {
|
||||
@ -5815,9 +5930,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
if (!vim.insertMode) {
|
||||
var isbackwards = !sel.cursor
|
||||
? session.selection.isBackwards() || session.selection.isEmpty()
|
||||
: Range.comparePoints(sel.cursor, sel.start) <= 0;
|
||||
: Range.comparePoints(sel.cursor, sel.start) <= 0
|
||||
if (!isbackwards && left > w)
|
||||
left -= w;
|
||||
left -= w
|
||||
}
|
||||
if (!vim.insertMode && vim.status) {
|
||||
h = h / 2;
|
||||
@ -5981,13 +6096,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
};
|
||||
var renderVirtualNumbers = {
|
||||
getText: function(session, row) {
|
||||
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + "";
|
||||
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + ""
|
||||
},
|
||||
getWidth: function(session, lastLineNumber, config) {
|
||||
return session.getLength().toString().length * config.characterWidth;
|
||||
},
|
||||
update: function(e, editor) {
|
||||
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);
|
||||
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER)
|
||||
},
|
||||
attach: function(editor) {
|
||||
editor.renderer.$gutterLayer.$renderer = this;
|
||||
@ -6005,6 +6120,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
},
|
||||
type: "boolean"
|
||||
}, false);
|
||||
Vim.defineEx('write', 'w', function() {
|
||||
console.log(':write is not implemented')
|
||||
});
|
||||
defaultKeymap.push(
|
||||
{ keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } },
|
||||
{ keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } },
|
||||
@ -6048,5 +6166,5 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||
exports.handler.actions = actions;
|
||||
exports.Vim = Vim;
|
||||
|
||||
Vim.map("Y", "yy");
|
||||
Vim.map("Y", "yy", "normal");
|
||||
});
|
||||
|
||||
207
node_modules/ace/lib/ace/keyboard/vim_test.js
generated
vendored
207
node_modules/ace/lib/ace/keyboard/vim_test.js
generated
vendored
@ -34,6 +34,7 @@ editor.session.setMode(new JavaScriptMode());
|
||||
function CodeMirror(place, opts) {
|
||||
if (opts.value != null)
|
||||
editor.session.setValue(opts.value);
|
||||
editor.setOption("indentedSoftWrap", false);
|
||||
editor.setOption("wrap", opts.lineWrapping);
|
||||
editor.setOption("useSoftTabs", !opts.indentWithTabs);
|
||||
editor.setKeyboardHandler(null);
|
||||
@ -58,6 +59,7 @@ function CodeMirror(place, opts) {
|
||||
cm.setSize(500, 300);
|
||||
return cm;
|
||||
}
|
||||
CodeMirror.defineMode = function() {}
|
||||
for (var key in vim.CodeMirror)
|
||||
CodeMirror[key] = vim.CodeMirror[key];
|
||||
var editor;
|
||||
@ -73,6 +75,9 @@ function test(name, fn) {
|
||||
}
|
||||
|
||||
vim.CodeMirror.Vim.unmap("Y");
|
||||
vim.CodeMirror.Vim.defineEx('write', 'w', function(cm) {
|
||||
CodeMirror.commands.save(cm);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -592,7 +597,7 @@ testVim('{', function(cm, vim, helpers) {
|
||||
helpers.doKeys('6', '{');
|
||||
helpers.assertCursorAt(0, 0);
|
||||
}, { value: 'a\n\nb\nc\n\nd' });
|
||||
testVim('paragraph motions', function(cm, vim, helpers) {
|
||||
testVim('paragraph_motions', function(cm, vim, helpers) {
|
||||
cm.setCursor(10, 0);
|
||||
helpers.doKeys('{');
|
||||
helpers.assertCursorAt(4, 0);
|
||||
@ -685,7 +690,7 @@ testVim('dl_eol', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq(' ', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 6);
|
||||
helpers.assertCursorAt(0, 5);
|
||||
}, { value: ' word1 ' });
|
||||
testVim('dl_repeat', function(cm, vim, helpers) {
|
||||
var curStart = makeCursor(0, 0);
|
||||
@ -767,6 +772,16 @@ testVim('dw_word', function(cm, vim, helpers) {
|
||||
is(!register.linewise);
|
||||
eqPos(curStart, cm.getCursor());
|
||||
}, { value: ' word1 word2' });
|
||||
testVim('dw_unicode_word', function(cm, vim, helpers) {
|
||||
helpers.doKeys('d', 'w');
|
||||
eq(cm.getValue().length, 10);
|
||||
helpers.doKeys('d', 'w');
|
||||
eq(cm.getValue().length, 6);
|
||||
helpers.doKeys('d', 'w');
|
||||
eq(cm.getValue().length, 5);
|
||||
helpers.doKeys('d', 'e');
|
||||
eq(cm.getValue().length, 2);
|
||||
}, { value: ' \u0562\u0561\u0580\u0587\xbbe\xb5g ' });
|
||||
testVim('dw_only_word', function(cm, vim, helpers) {
|
||||
// Test that if there is only 1 word left, dw deletes till the end of the
|
||||
// line.
|
||||
@ -776,7 +791,7 @@ testVim('dw_only_word', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq('word1 ', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 1);
|
||||
helpers.assertCursorAt(0, 0);
|
||||
}, { value: ' word1 ' });
|
||||
testVim('dw_eol', function(cm, vim, helpers) {
|
||||
// Assert that dw does not delete the newline if last word to delete is at end
|
||||
@ -787,7 +802,7 @@ testVim('dw_eol', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq('word1', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 1);
|
||||
helpers.assertCursorAt(0, 0);
|
||||
}, { value: ' word1\nword2' });
|
||||
testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) {
|
||||
// Assert that dw does not delete the newline if last word to delete is at end
|
||||
@ -798,7 +813,7 @@ testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq('word1', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 1);
|
||||
helpers.assertCursorAt(0, 0);
|
||||
}, { value: ' word1\n\nword2' });
|
||||
testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) {
|
||||
cm.setCursor(0, 0);
|
||||
@ -844,7 +859,7 @@ testVim('dw_repeat', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq('word1\nword2', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 1);
|
||||
helpers.assertCursorAt(0, 0);
|
||||
}, { value: ' word1\nword2' });
|
||||
testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) {
|
||||
cm.setCursor(0, 0);
|
||||
@ -1062,6 +1077,17 @@ testVim('cc_multiply_repeat', function(cm, vim, helpers) {
|
||||
is(register.linewise);
|
||||
eq('vim-insert', cm.getOption('keyMap'));
|
||||
});
|
||||
testVim('ct', function(cm, vim, helpers) {
|
||||
cm.setCursor(0, 9);
|
||||
helpers.doKeys('c', 't', 'w');
|
||||
eq(' word1 word3', cm.getValue());
|
||||
helpers.doKeys('<Esc>', 'c', '|');
|
||||
eq(' word3', cm.getValue());
|
||||
helpers.assertCursorAt(0, 0);
|
||||
helpers.doKeys('<Esc>', '2', 'u', 'w', 'h');
|
||||
helpers.doKeys('c', '2', 'g', 'e');
|
||||
eq(' wordword3', cm.getValue());
|
||||
}, { value: ' word1 word2 word3'});
|
||||
testVim('cc_should_not_append_to_document', function(cm, vim, helpers) {
|
||||
var expectedLineCount = cm.lineCount();
|
||||
cm.setCursor(cm.lastLine(), 0);
|
||||
@ -1371,7 +1397,7 @@ testVim('D', function(cm, vim, helpers) {
|
||||
var register = helpers.getRegisterController().getRegister();
|
||||
eq('rd1', register.toString());
|
||||
is(!register.linewise);
|
||||
helpers.assertCursorAt(0, 3);
|
||||
helpers.assertCursorAt(0, 2);
|
||||
}, { value: ' word1\nword2\n word3' });
|
||||
testVim('C', function(cm, vim, helpers) {
|
||||
var curStart = makeCursor(0, 3);
|
||||
@ -1962,8 +1988,11 @@ testVim('visual_block_move_to_eol', function(cm, vim, helpers) {
|
||||
cm.setCursor(0, 0);
|
||||
helpers.doKeys('<C-v>', 'G', '$');
|
||||
var selections = cm.getSelections().join();
|
||||
console.log(selections);
|
||||
eq("123,45,6", selections);
|
||||
eq('123,45,6', selections);
|
||||
// Checks that with cursor at Infinity, finding words backwards still works.
|
||||
helpers.doKeys('2', 'k', 'b');
|
||||
selections = cm.getSelections().join();
|
||||
eq('1', selections);
|
||||
}, {value: '123\n45\n6'});
|
||||
testVim('visual_block_different_line_lengths', function(cm, vim, helpers) {
|
||||
// test the block selection with lines of different length
|
||||
@ -2053,6 +2082,11 @@ testVim('visual_join', function(cm, vim, helpers) {
|
||||
eq(' 1 2 3\n 4\n 5', cm.getValue());
|
||||
is(!vim.visualMode);
|
||||
}, { value: ' 1\n 2\n 3\n 4\n 5' });
|
||||
testVim('visual_join_2', function(cm, vim, helpers) {
|
||||
helpers.doKeys('G', 'V', 'g', 'g', 'J');
|
||||
eq('1 2 3 4 5 6 ', cm.getValue());
|
||||
is(!vim.visualMode);
|
||||
}, { value: '1\n2\n3\n4\n5\n6\n'});
|
||||
testVim('visual_blank', function(cm, vim, helpers) {
|
||||
helpers.doKeys('v', 'k');
|
||||
eq(vim.visualMode, true);
|
||||
@ -2260,6 +2294,15 @@ testVim('S_visual', function(cm, vim, helpers) {
|
||||
eq('\ncc', cm.getValue());
|
||||
}, { value: 'aa\nbb\ncc'});
|
||||
|
||||
testVim('d_/', function(cm, vim, helpers) {
|
||||
cm.openDialog = helpers.fakeOpenDialog('match');
|
||||
helpers.doKeys('2', 'd', '/');
|
||||
helpers.assertCursorAt(0, 0);
|
||||
eq('match \n next', cm.getValue());
|
||||
cm.openDialog = helpers.fakeOpenDialog('2');
|
||||
helpers.doKeys('d', ':');
|
||||
// TODO eq(' next', cm.getValue());
|
||||
}, { value: 'text match match \n next' });
|
||||
testVim('/ and n/N', function(cm, vim, helpers) {
|
||||
cm.openDialog = helpers.fakeOpenDialog('match');
|
||||
helpers.doKeys('/');
|
||||
@ -2777,6 +2820,44 @@ testVim('exCommand_history', function(cm, vim, helpers) {
|
||||
onKeyDown({keyCode: keyCodes.Up}, input, close);
|
||||
eq(input, 'sort');
|
||||
}, {value: ''});
|
||||
testVim('search_clear', function(cm, vim, helpers) {
|
||||
var onKeyDown;
|
||||
var input = '';
|
||||
var keyCodes = {
|
||||
Ctrl: 17,
|
||||
u: 85
|
||||
};
|
||||
cm.openDialog = function(template, callback, options) {
|
||||
onKeyDown = options.onKeyDown;
|
||||
};
|
||||
var close = function(newVal) {
|
||||
if (typeof newVal == 'string') input = newVal;
|
||||
}
|
||||
helpers.doKeys('/');
|
||||
input = 'foo';
|
||||
onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
|
||||
onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
|
||||
eq(input, '');
|
||||
});
|
||||
testVim('exCommand_clear', function(cm, vim, helpers) {
|
||||
var onKeyDown;
|
||||
var input = '';
|
||||
var keyCodes = {
|
||||
Ctrl: 17,
|
||||
u: 85
|
||||
};
|
||||
cm.openDialog = function(template, callback, options) {
|
||||
onKeyDown = options.onKeyDown;
|
||||
};
|
||||
var close = function(newVal) {
|
||||
if (typeof newVal == 'string') input = newVal;
|
||||
}
|
||||
helpers.doKeys(':');
|
||||
input = 'foo';
|
||||
onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
|
||||
onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
|
||||
eq(input, '');
|
||||
});
|
||||
testVim('.', function(cm, vim, helpers) {
|
||||
cm.setCursor(0, 0);
|
||||
helpers.doKeys('2', 'd', 'w');
|
||||
@ -3204,7 +3285,7 @@ testVim('scrollMotion', function(cm, vim, helpers){
|
||||
cm.refresh(); //ace!
|
||||
prevScrollInfo = cm.getScrollInfo();
|
||||
helpers.doKeys('<C-y>');
|
||||
eq(prevCursor.line - 1, cm.getCursor().line);
|
||||
eq(prevCursor.line - 1, cm.getCursor().line, "Y");
|
||||
is(prevScrollInfo.top > cm.getScrollInfo().top);
|
||||
}, { value: scrollMotionSandbox});
|
||||
|
||||
@ -3727,17 +3808,111 @@ testVim('set_string', function(cm, vim, helpers) {
|
||||
eq('c', CodeMirror.Vim.getOption('testoption'));
|
||||
});
|
||||
testVim('ex_set_string', function(cm, vim, helpers) {
|
||||
CodeMirror.Vim.defineOption('testoption', 'a', 'string');
|
||||
CodeMirror.Vim.defineOption('testopt', 'a', 'string');
|
||||
// Test default value is set.
|
||||
eq('a', CodeMirror.Vim.getOption('testoption'));
|
||||
eq('a', CodeMirror.Vim.getOption('testopt'));
|
||||
try {
|
||||
// Test fail to set 'notestoption'
|
||||
helpers.doEx('set notestoption=b');
|
||||
// Test fail to set 'notestopt'
|
||||
helpers.doEx('set notestopt=b');
|
||||
fail();
|
||||
} catch (expected) {};
|
||||
// Test setOption
|
||||
helpers.doEx('set testoption=c')
|
||||
eq('c', CodeMirror.Vim.getOption('testoption'));
|
||||
helpers.doEx('set testopt=c')
|
||||
eq('c', CodeMirror.Vim.getOption('testopt'));
|
||||
helpers.doEx('set testopt=c')
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global
|
||||
eq('c', CodeMirror.Vim.getOption('testopt')); // global
|
||||
// Test setOption global
|
||||
helpers.doEx('setg testopt=d')
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm));
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt'));
|
||||
// Test setOption local
|
||||
helpers.doEx('setl testopt=e')
|
||||
eq('e', CodeMirror.Vim.getOption('testopt', cm));
|
||||
eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt'));
|
||||
});
|
||||
testVim('ex_set_callback', function(cm, vim, helpers) {
|
||||
var global;
|
||||
|
||||
function cb(val, cm, cfg) {
|
||||
if (val === undefined) {
|
||||
// Getter
|
||||
if (cm) {
|
||||
return cm._local;
|
||||
} else {
|
||||
return global;
|
||||
}
|
||||
} else {
|
||||
// Setter
|
||||
if (cm) {
|
||||
cm._local = val;
|
||||
} else {
|
||||
global = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CodeMirror.Vim.defineOption('testopt', 'a', 'string', cb);
|
||||
// Test default value is set.
|
||||
eq('a', CodeMirror.Vim.getOption('testopt'));
|
||||
try {
|
||||
// Test fail to set 'notestopt'
|
||||
helpers.doEx('set notestopt=b');
|
||||
fail();
|
||||
} catch (expected) {};
|
||||
// Test setOption (Identical to the string tests, but via callback instead)
|
||||
helpers.doEx('set testopt=c')
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global
|
||||
eq('c', CodeMirror.Vim.getOption('testopt')); // global
|
||||
// Test setOption global
|
||||
helpers.doEx('setg testopt=d')
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm));
|
||||
eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt'));
|
||||
// Test setOption local
|
||||
helpers.doEx('setl testopt=e')
|
||||
eq('e', CodeMirror.Vim.getOption('testopt', cm));
|
||||
eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
|
||||
eq('d', CodeMirror.Vim.getOption('testopt'));
|
||||
})
|
||||
testVim('ex_set_filetype', function(cm, vim, helpers) {
|
||||
CodeMirror.defineMode('test_mode', function() {
|
||||
return {token: function(stream) {
|
||||
stream.match(/^\s+|^\S+/);
|
||||
}};
|
||||
});
|
||||
CodeMirror.defineMode('test_mode_2', function() {
|
||||
return {token: function(stream) {
|
||||
stream.match(/^\s+|^\S+/);
|
||||
}};
|
||||
});
|
||||
// Test mode is set.
|
||||
helpers.doEx('set filetype=test_mode');
|
||||
eq('test_mode', cm.getMode().name);
|
||||
// Test 'ft' alias also sets mode.
|
||||
helpers.doEx('set ft=test_mode_2');
|
||||
eq('test_mode_2', cm.getMode().name);
|
||||
});
|
||||
testVim('ex_set_filetype_null', function(cm, vim, helpers) {
|
||||
CodeMirror.defineMode('test_mode', function() {
|
||||
return {token: function(stream) {
|
||||
stream.match(/^\s+|^\S+/);
|
||||
}};
|
||||
});
|
||||
cm.setOption('mode', 'test_mode');
|
||||
// Test mode is set to null.
|
||||
helpers.doEx('set filetype=');
|
||||
eq('null', cm.getMode().name);
|
||||
});
|
||||
// TODO: Reset key maps after each test.
|
||||
testVim('ex_map_key2key', function(cm, vim, helpers) {
|
||||
|
||||
10
node_modules/ace/lib/ace/layer/marker.js
generated
vendored
10
node_modules/ace/lib/ace/layer/marker.js
generated
vendored
@ -104,22 +104,24 @@ var Marker = function(parentEl) {
|
||||
this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) {
|
||||
// selection start
|
||||
var row = range.start.row;
|
||||
var session = this.session;
|
||||
|
||||
var lineRange = new Range(
|
||||
row, range.start.column,
|
||||
row, this.session.getScreenLastRowColumn(row)
|
||||
row, session.getScreenLastRowColumn(row)
|
||||
);
|
||||
this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " ace_start", layerConfig, 1, extraStyle);
|
||||
|
||||
// selection end
|
||||
row = range.end.row;
|
||||
lineRange = new Range(row, 0, row, range.end.column);
|
||||
lineRange = new Range(row, session.getRowWrapIndent(row), row, range.end.column);
|
||||
this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, extraStyle);
|
||||
|
||||
for (row = range.start.row + 1; row < range.end.row; row++) {
|
||||
lineRange.start.row = row;
|
||||
lineRange.start.column = session.getRowWrapIndent(row);
|
||||
lineRange.end.row = row;
|
||||
lineRange.end.column = this.session.getScreenLastRowColumn(row);
|
||||
lineRange.end.column = session.getScreenLastRowColumn(row);
|
||||
this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, extraStyle);
|
||||
}
|
||||
};
|
||||
@ -155,7 +157,7 @@ var Marker = function(parentEl) {
|
||||
|
||||
// all the complete lines
|
||||
height = (range.end.row - range.start.row - 1) * config.lineHeight;
|
||||
if (height < 0)
|
||||
if (height <= 0)
|
||||
return;
|
||||
top = this.$getTop(range.start.row + 1, config);
|
||||
|
||||
|
||||
16
node_modules/ace/lib/ace/layer/text.js
generated
vendored
16
node_modules/ace/lib/ace/layer/text.js
generated
vendored
@ -129,10 +129,10 @@ var Text = function(parentEl) {
|
||||
if (this.showInvisibles) {
|
||||
tabStr.push("<span class='ace_invisible ace_invisible_tab'>"
|
||||
+ this.TAB_CHAR
|
||||
+ lang.stringRepeat("\xa0", i - 1)
|
||||
+ lang.stringRepeat(" ", i - 1)
|
||||
+ "</span>");
|
||||
} else {
|
||||
tabStr.push(lang.stringRepeat("\xa0", i));
|
||||
tabStr.push(lang.stringRepeat(" ", i));
|
||||
}
|
||||
}
|
||||
if (this.displayIndentGuides) {
|
||||
@ -145,9 +145,9 @@ var Text = function(parentEl) {
|
||||
spaceClass = " ace_invisible_space";
|
||||
tabClass = " ace_invisible_tab";
|
||||
var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize);
|
||||
var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1);
|
||||
var tabContent = this.TAB_CHAR + lang.stringRepeat(" ", this.tabSize - 1);
|
||||
} else{
|
||||
var spaceContent = lang.stringRepeat("\xa0", this.tabSize);
|
||||
var spaceContent = lang.stringRepeat(" ", this.tabSize);
|
||||
var tabContent = spaceContent;
|
||||
}
|
||||
|
||||
@ -325,9 +325,9 @@ var Text = function(parentEl) {
|
||||
var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g;
|
||||
var replaceFunc = function(c, a, b, tabIdx, idx4) {
|
||||
if (a) {
|
||||
return self.showInvisibles ?
|
||||
"<span class='ace_invisible ace_invisible_space'>" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "</span>" :
|
||||
lang.stringRepeat("\xa0", c.length);
|
||||
return self.showInvisibles
|
||||
? "<span class='ace_invisible ace_invisible_space'>" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "</span>"
|
||||
: c;
|
||||
} else if (c == "&") {
|
||||
return "&";
|
||||
} else if (c == "<") {
|
||||
@ -420,6 +420,8 @@ var Text = function(parentEl) {
|
||||
);
|
||||
}
|
||||
|
||||
stringBuilder.push(lang.stringRepeat("\xa0", splits.indent));
|
||||
|
||||
split ++;
|
||||
screenColumn = 0;
|
||||
splitChars = splits[split] || Number.MAX_VALUE;
|
||||
|
||||
2
node_modules/ace/lib/ace/layer/text_test.js
generated
vendored
2
node_modules/ace/lib/ace/layer/text_test.js
generated
vendored
@ -89,7 +89,7 @@ module.exports = {
|
||||
"test rendering of indent guides" : function() {
|
||||
var textLayer = this.textLayer
|
||||
var EOL = "<span class='ace_invisible ace_invisible_eol'>" + textLayer.EOL_CHAR + "</span>";
|
||||
var SPACE = function(i) {return Array(i+1).join("\xa0")}
|
||||
var SPACE = function(i) {return Array(i+1).join(" ")}
|
||||
var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)}
|
||||
var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)}
|
||||
function testRender(results) {
|
||||
|
||||
11
node_modules/ace/lib/ace/lib/event.js
generated
vendored
11
node_modules/ace/lib/ace/lib/event.js
generated
vendored
@ -241,12 +241,11 @@ function normalizeCommandKeys(callback, e, keyCode) {
|
||||
if (keyCode === 18 || keyCode === 17) {
|
||||
var location = "location" in e ? e.location : e.keyLocation;
|
||||
if (keyCode === 17 && location === 1) {
|
||||
ts = e.timeStamp;
|
||||
if (pressedKeys[keyCode] == 1)
|
||||
ts = e.timeStamp;
|
||||
} else if (keyCode === 18 && hashId === 3 && location === 2) {
|
||||
var dt = -ts;
|
||||
ts = e.timeStamp;
|
||||
dt += ts;
|
||||
if (dt < 3)
|
||||
var dt = e.timestamp - ts;
|
||||
if (dt < 50)
|
||||
pressedKeys.altGr = true;
|
||||
}
|
||||
}
|
||||
@ -309,7 +308,7 @@ exports.addCommandKeyListener = function(el, callback) {
|
||||
var lastDefaultPrevented = null;
|
||||
|
||||
addListener(el, "keydown", function(e) {
|
||||
pressedKeys[e.keyCode] = true;
|
||||
pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;
|
||||
var result = normalizeCommandKeys(callback, e, e.keyCode);
|
||||
lastDefaultPrevented = e.defaultPrevented;
|
||||
return result;
|
||||
|
||||
4
node_modules/ace/lib/ace/lib/keys.js
generated
vendored
4
node_modules/ace/lib/ace/lib/keys.js
generated
vendored
@ -104,8 +104,8 @@ var Keys = (function() {
|
||||
73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o',
|
||||
80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v',
|
||||
87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.',
|
||||
187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', 219: '[',
|
||||
220: '\\',221: ']', 222: '\''
|
||||
186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',
|
||||
219: '[', 220: '\\',221: ']', 222: '\''
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
18
node_modules/ace/lib/ace/lib/lang.js
generated
vendored
18
node_modules/ace/lib/ace/lib/lang.js
generated
vendored
@ -81,20 +81,24 @@ exports.copyArray = function(array){
|
||||
return copy;
|
||||
};
|
||||
|
||||
exports.deepCopy = function (obj) {
|
||||
exports.deepCopy = function deepCopy(obj) {
|
||||
if (typeof obj !== "object" || !obj)
|
||||
return obj;
|
||||
var copy;
|
||||
if (Array.isArray(obj)) {
|
||||
copy = [];
|
||||
for (var key = 0; key < obj.length; key++) {
|
||||
copy[key] = deepCopy(obj[key]);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
var cons = obj.constructor;
|
||||
if (cons === RegExp)
|
||||
return obj;
|
||||
|
||||
var copy = cons();
|
||||
copy = cons();
|
||||
for (var key in obj) {
|
||||
if (typeof obj[key] === "object") {
|
||||
copy[key] = exports.deepCopy(obj[key]);
|
||||
} else {
|
||||
copy[key] = obj[key];
|
||||
}
|
||||
copy[key] = deepCopy(obj[key]);
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
|
||||
4
node_modules/ace/lib/ace/mode/_test/tokens_vbscript.json
generated
vendored
4
node_modules/ace/lib/ace/mode/_test/tokens_vbscript.json
generated
vendored
@ -199,7 +199,5 @@
|
||||
["string.quoted.double.asp"," ... updated.\""]
|
||||
],[
|
||||
"start",
|
||||
["support.function.asp","End"],
|
||||
["text"," "],
|
||||
["storage.type.asp","Sub"]
|
||||
["storage.type.asp","End Sub"]
|
||||
]]
|
||||
34
node_modules/ace/lib/ace/mode/behaviour/behaviour_test.js
generated
vendored
34
node_modules/ace/lib/ace/mode/behaviour/behaviour_test.js
generated
vendored
@ -30,6 +30,7 @@
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
require("../../test/mockdom");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
@ -42,6 +43,7 @@ var Editor = require("../../editor").Editor;
|
||||
var EditSession = require("../../edit_session").EditSession;
|
||||
var MockRenderer = require("../../test/mockrenderer").MockRenderer;
|
||||
var JavaScriptMode = require("../javascript").Mode;
|
||||
var XMLMode = require("../xml").Mode;
|
||||
var editor;
|
||||
var exec = function(name, times, args) {
|
||||
do {
|
||||
@ -117,9 +119,9 @@ module.exports = {
|
||||
|
||||
editor.setValue("");
|
||||
exec("insertstring", 1, "{");
|
||||
assert.equal(editor.getValue(), "{")
|
||||
assert.equal(editor.getValue(), "{");
|
||||
exec("insertstring", 1, "\n");
|
||||
assert.equal(editor.getValue(), "{\n \n}")
|
||||
assert.equal(editor.getValue(), "{\n \n}");
|
||||
|
||||
editor.setValue("");
|
||||
exec("insertstring", 1, "(");
|
||||
@ -129,6 +131,34 @@ module.exports = {
|
||||
exec("backspace", 1);
|
||||
exec("insertstring", 1, '"');
|
||||
assert.equal(editor.getValue(), '("")');
|
||||
|
||||
editor.setValue("('foo')", 1);
|
||||
exec("gotoleft", 1);
|
||||
exec("selectleft", 1);
|
||||
exec("selectMoreBefore", 1);
|
||||
exec("insertstring", 1, "'");
|
||||
assert.equal(editor.getValue(), "('foo')");
|
||||
exec("selectleft", 1);
|
||||
exec("insertstring", 1, '"');
|
||||
assert.equal(editor.getValue(), '("foo")');
|
||||
exec("selectleft", 1);
|
||||
exec("insertstring", 1, '"');
|
||||
assert.equal(editor.getValue(), '("foo")');
|
||||
},
|
||||
"test: xml": function() {
|
||||
editor = new Editor(new MockRenderer());
|
||||
editor.setValue(["<OuterTag>",
|
||||
" <SelfClosingTag />"
|
||||
].join("\n"));
|
||||
editor.session.setMode(new XMLMode);
|
||||
exec("gotolinedown", 1);
|
||||
exec("gotolineend", 1);
|
||||
exec("insertstring", 1, '\n');
|
||||
assert.equal(editor.session.getLine(2), " ");
|
||||
exec("gotolineup", 1);
|
||||
exec("gotolineend", 1);
|
||||
exec("insertstring", 1, '\n');
|
||||
assert.equal(editor.session.getLine(2), " ");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
35
node_modules/ace/lib/ace/mode/behaviour/cstyle.js
generated
vendored
35
node_modules/ace/lib/ace/mode/behaviour/cstyle.js
generated
vendored
@ -63,6 +63,19 @@ var initContext = function(editor) {
|
||||
};
|
||||
};
|
||||
|
||||
var getWrapped = function(selection, selected, opening, closing) {
|
||||
var rowDiff = selection.end.row - selection.start.row;
|
||||
return {
|
||||
text: opening + selected + closing,
|
||||
selection: [
|
||||
0,
|
||||
selection.start.column + 1,
|
||||
rowDiff,
|
||||
selection.end.column + (rowDiff ? 0 : 1)
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
var CstyleBehaviour = function() {
|
||||
this.add("braces", "insertion", function(state, action, editor, session, text) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
@ -72,10 +85,7 @@ var CstyleBehaviour = function() {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
||||
return {
|
||||
text: '{' + selected + '}',
|
||||
selection: false
|
||||
};
|
||||
return getWrapped(selection, selected, '{', '}');
|
||||
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||
if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
|
||||
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
||||
@ -155,10 +165,7 @@ var CstyleBehaviour = function() {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
||||
return {
|
||||
text: '(' + selected + ')',
|
||||
selection: false
|
||||
};
|
||||
return getWrapped(selection, selected, '(', ')');
|
||||
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
||||
return {
|
||||
@ -203,10 +210,7 @@ var CstyleBehaviour = function() {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
||||
return {
|
||||
text: '[' + selected + ']',
|
||||
selection: false
|
||||
};
|
||||
return getWrapped(selection, selected, '[', ']');
|
||||
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
||||
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
||||
return {
|
||||
@ -252,11 +256,8 @@ var CstyleBehaviour = function() {
|
||||
var selection = editor.getSelectionRange();
|
||||
var selected = session.doc.getTextRange(selection);
|
||||
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
||||
return {
|
||||
text: quote + selected + quote,
|
||||
selection: false
|
||||
};
|
||||
} else {
|
||||
return getWrapped(selection, selected, quote, quote);
|
||||
} else if (!selected) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var leftChar = line.substring(cursor.column-1, cursor.column);
|
||||
|
||||
2
node_modules/ace/lib/ace/mode/behaviour/xml.js
generated
vendored
2
node_modules/ace/lib/ace/mode/behaviour/xml.js
generated
vendored
@ -155,6 +155,8 @@ var XmlBehaviour = function () {
|
||||
var token = iterator.getCurrentToken();
|
||||
|
||||
if (token && token.type.indexOf("tag-close") !== -1) {
|
||||
if (token.value == "/>")
|
||||
return;
|
||||
//get tag name
|
||||
while (token && token.type.indexOf("tag-name") === -1) {
|
||||
token = iterator.stepBackward();
|
||||
|
||||
10
node_modules/ace/lib/ace/mode/folding/cstyle.js
generated
vendored
10
node_modules/ace/lib/ace/mode/folding/cstyle.js
generated
vendored
@ -53,7 +53,7 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
||||
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
||||
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
|
||||
this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
|
||||
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
|
||||
|
||||
//prevent naming conflict with any modes that inherit from cstyle and override this (like csharp)
|
||||
this._getFoldWidgetBase = this.getFoldWidget;
|
||||
@ -69,6 +69,8 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||
*
|
||||
* @example tripleStarFoldingSection
|
||||
* /*** this folds even though 1 line because it has 3 stars ***[/]
|
||||
*
|
||||
* @note the pound symbol for region tags is optional
|
||||
*/
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
@ -158,12 +160,16 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
||||
};
|
||||
|
||||
/**
|
||||
* gets comment region block with end region assumed to be start of comment in any cstyle mode or SQL mode (--) which inherits from this.
|
||||
* There may optionally be a pound symbol before the region/endregion statement
|
||||
*/
|
||||
this.getCommentRegionBlock = function(session, line, row) {
|
||||
var startColumn = line.search(/\s*$/);
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
|
||||
var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
|
||||
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
||||
var depth = 1;
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
|
||||
111
node_modules/ace/lib/ace/mode/folding/sqlserver.js
generated
vendored
Normal file
111
node_modules/ace/lib/ace/mode/folding/sqlserver.js
generated
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
/* ***** 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";
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Range = require("../../range").Range;
|
||||
var BaseFoldMode = require("./cstyle").FoldMode;
|
||||
|
||||
var FoldMode = exports.FoldMode = function() {};
|
||||
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
|
||||
(function() {
|
||||
/**
|
||||
* Inheriting cstyle folding because it handles the region comment folding
|
||||
* and special block comment folding appropriately.
|
||||
*
|
||||
* Cstyle's getCommentRegionBlock() contains the sql comment characters '--' for end region block.
|
||||
*/
|
||||
|
||||
this.foldingStartMarker = /(\bCASE\b|\bBEGIN\b)|^\s*(\/\*)/i;
|
||||
// this.foldingStopMarker = /(\bEND\b)|^[\s\*]*(\*\/)/i;
|
||||
this.startRegionRe = /^\s*(\/\*|--)#?region\b/;
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
||||
var line = session.getLine(row);
|
||||
|
||||
if (this.startRegionRe.test(line)) return this.getCommentRegionBlock(session, line, row);
|
||||
|
||||
var match = line.match(this.foldingStartMarker);
|
||||
if (match) {
|
||||
var i = match.index;
|
||||
if (match[1]) return this.getBeginEndBlock(session, row, i, match[1]);
|
||||
|
||||
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
||||
if (range && !range.isMultiLine()) {
|
||||
if (forceMultiline) {
|
||||
range = this.getSectionRange(session, row);
|
||||
}
|
||||
else if (foldStyle != "all") range = null;
|
||||
}
|
||||
|
||||
return range;
|
||||
}
|
||||
|
||||
if (foldStyle === "markbegin") return;
|
||||
//TODO: add support for end folding markers
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {range} folding block for sequence that starts with 'CASE' or 'BEGIN' and ends with 'END'
|
||||
* @param {string} matchSequence - the sequence of charaters that started the fold widget, which should remain visible when the fold widget is folded
|
||||
*/
|
||||
this.getBeginEndBlock = function(session, row, column, matchSequence) {
|
||||
var start = {
|
||||
row: row,
|
||||
column: column + matchSequence.length
|
||||
};
|
||||
var maxRow = session.getLength();
|
||||
var line;
|
||||
|
||||
var depth = 1;
|
||||
var re = /(\bCASE\b|\bBEGIN\b)|(\bEND\b)/i;
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var m = re.exec(line);
|
||||
if (!m) continue;
|
||||
if (m[1]) depth++;
|
||||
else depth--;
|
||||
|
||||
if (!depth) break;
|
||||
}
|
||||
var endRow = row;
|
||||
if (endRow > start.row) {
|
||||
return new Range(start.row, start.column, endRow, line.length);
|
||||
}
|
||||
};
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
2
node_modules/ace/lib/ace/mode/javascript_highlight_rules.js
generated
vendored
2
node_modules/ace/lib/ace/mode/javascript_highlight_rules.js
generated
vendored
@ -172,7 +172,7 @@ var JavaScriptHighlightRules = function(options) {
|
||||
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(?=\()/
|
||||
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|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
|
||||
}, {
|
||||
token : ["punctuation.operator", "support.constant"],
|
||||
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
|
||||
|
||||
101
node_modules/ace/lib/ace/mode/lean.js
generated
vendored
Normal file
101
node_modules/ace/lib/ace/mode/lean.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
/* ***** 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";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var leanHighlightRules = require("./lean_highlight_rules").leanHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var Range = require("../range").Range;
|
||||
// TODO(soonhok): figure out behavior and foldmode
|
||||
// var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
// var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.HighlightRules = leanHighlightRules;
|
||||
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
// this.$behaviour = new CstyleBehaviour();
|
||||
// this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.lineCommentStart = "--";
|
||||
this.blockComment = {start: "/-", end: "-/"};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
var endState = tokenizedLine.state;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
} else if (state == "doc-start") {
|
||||
if (endState == "start") {
|
||||
return "";
|
||||
}
|
||||
var match = line.match(/^\s*(\/?)\*/);
|
||||
if (match) {
|
||||
if (match[1]) {
|
||||
indent += " ";
|
||||
}
|
||||
indent += "- ";
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/lean";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
156
node_modules/ace/lib/ace/mode/lean_highlight_rules.js
generated
vendored
Normal file
156
node_modules/ace/lib/ace/mode/lean_highlight_rules.js
generated
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/* ***** 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";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var leanHighlightRules = function() {
|
||||
|
||||
var keywordControls = (
|
||||
[ "add_rewrite", "alias", "as", "assume", "attribute",
|
||||
"begin", "by", "calc", "calc_refl", "calc_subst", "calc_trans", "check",
|
||||
"classes", "coercions", "conjecture", "constants", "context",
|
||||
"corollary", "else", "end", "environment", "eval", "example",
|
||||
"exists", "exit", "export", "exposing", "extends", "fields", "find_decl",
|
||||
"forall", "from", "fun", "have", "help", "hiding", "if",
|
||||
"import", "in", "infix", "infixl", "infixr", "instances",
|
||||
"let", "local", "match", "namespace", "notation", "obtain", "obtains",
|
||||
"omit", "opaque", "open", "options", "parameter", "parameters", "postfix",
|
||||
"precedence", "prefix", "premise", "premises", "print", "private", "proof",
|
||||
"protected", "qed", "raw", "renaming", "section", "set_option",
|
||||
"show", "tactic_hint", "take", "then", "universe",
|
||||
"universes", "using", "variable", "variables", "with"].join("|")
|
||||
);
|
||||
|
||||
var nameProviders = (
|
||||
["inductive", "structure", "record", "theorem", "axiom",
|
||||
"axioms", "lemma", "hypothesis", "definition", "constant"].join("|")
|
||||
);
|
||||
|
||||
var storageType = (
|
||||
["Prop", "Type", "Type'", "Type₊", "Type₁", "Type₂", "Type₃"].join("|")
|
||||
);
|
||||
|
||||
var storageModifiers = (
|
||||
"\\[(" +
|
||||
["abbreviations", "all-transparent", "begin-end-hints", "class", "classes", "coercion",
|
||||
"coercions", "declarations", "decls", "instance", "irreducible",
|
||||
"multiple-instances", "notation", "notations", "parsing-only", "persistent",
|
||||
"reduce-hints", "reducible", "tactic-hints", "visible", "wf", "whnf"
|
||||
].join("|") +
|
||||
")\\]"
|
||||
);
|
||||
|
||||
var keywordOperators = (
|
||||
[].join("|")
|
||||
);
|
||||
|
||||
var keywordMapper = this.$keywords = this.createKeywordMapper({
|
||||
"keyword.control" : keywordControls,
|
||||
"storage.type" : storageType,
|
||||
"keyword.operator" : keywordOperators,
|
||||
"variable.language": "sorry",
|
||||
}, "identifier");
|
||||
|
||||
var identifierRe = "[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f][A-Za-z0-9_'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079\u207f-\u2089\u2090-\u209c\u2100-\u214f]*";
|
||||
var operatorRe = new RegExp(["#", "@", "->", "∼", "↔", "/", "==", "=", ":=", "<->",
|
||||
"/\\", "\\/", "∧", "∨", "≠", "<", ">", "≤", "≥", "¬",
|
||||
"<=", ">=", "⁻¹", "⬝", "▸", "\\+", "\\*", "-", "/",
|
||||
"λ", "→", "∃", "∀", ":="].join("|"));
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "comment", // single line comment "--"
|
||||
regex : "--.*$"
|
||||
},
|
||||
DocCommentHighlightRules.getStartRule("doc-start"),
|
||||
{
|
||||
token : "comment", // multi line comment "/-"
|
||||
regex : "\\/-",
|
||||
next : "comment"
|
||||
}, {
|
||||
stateName: "qqstring",
|
||||
token : "string.start", regex : '"', next : [
|
||||
{token : "string.end", regex : '"', next : "start"},
|
||||
{token : "constant.language.escape", regex : /\\[n"\\]/},
|
||||
{defaultToken: "string"}
|
||||
]
|
||||
}, {
|
||||
token : "keyword.control", regex : nameProviders, next : [
|
||||
{token : "variable.language", regex : identifierRe, next : "start"} ]
|
||||
}, {
|
||||
token : "constant.numeric", // hex
|
||||
regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
|
||||
}, {
|
||||
token : "storage.modifier",
|
||||
regex : storageModifiers
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : identifierRe
|
||||
}, {
|
||||
token : "operator",
|
||||
regex : operatorRe
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\;|\\."
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
}
|
||||
],
|
||||
"comment" : [ {token: "comment", regex: "-/", next: "start"},
|
||||
{defaultToken: "comment"} ]
|
||||
};
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
oop.inherits(leanHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.leanHighlightRules = leanHighlightRules;
|
||||
});
|
||||
27
node_modules/ace/lib/ace/mode/rust_highlight_rules.js
generated
vendored
27
node_modules/ace/lib/ace/mode/rust_highlight_rules.js
generated
vendored
@ -36,6 +36,7 @@ define(function(require, exports, module) {
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var stringEscape = /\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\})/.source;
|
||||
var RustHighlightRules = function() {
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
@ -44,13 +45,7 @@ var RustHighlightRules = function() {
|
||||
[ { token: 'variable.other.source.rust',
|
||||
regex: '\'[a-zA-Z_][a-zA-Z0-9_]*[^\\\']' },
|
||||
{ token: 'string.quoted.single.source.rust',
|
||||
regex: '\'',
|
||||
push:
|
||||
[ { token: 'string.quoted.single.source.rust',
|
||||
regex: '\'',
|
||||
next: 'pop' },
|
||||
{ include: '#rust_escaped_character' },
|
||||
{ defaultToken: 'string.quoted.single.source.rust' } ] },
|
||||
regex: "'(?:[^'\\\\]|" + stringEscape + ")'" },
|
||||
{
|
||||
stateName: "bracketedComment",
|
||||
onMatch : function(value, currentState, stack){
|
||||
@ -86,16 +81,17 @@ var RustHighlightRules = function() {
|
||||
[ { token: 'string.quoted.double.source.rust',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#rust_escaped_character' },
|
||||
{ token: 'constant.character.escape.source.rust',
|
||||
regex: stringEscape },
|
||||
{ defaultToken: 'string.quoted.double.source.rust' } ] },
|
||||
{ token: [ 'keyword.source.rust', 'meta.function.source.rust',
|
||||
'entity.name.function.source.rust', 'meta.function.source.rust' ],
|
||||
regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_][\\w\\:,+ \\\'<>]*)(\\s*\\()' },
|
||||
{ token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' },
|
||||
{ token: 'keyword.source.rust',
|
||||
regex: '\\b(?:as|assert|break|claim|const|copy|Copy|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' },
|
||||
regex: '\\b(?:as|assert|break|claim|const|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' },
|
||||
{ token: 'storage.type.source.rust',
|
||||
regex: '\\b(?:Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' },
|
||||
regex: '\\b(?:Self|m32|m64|m128|f80|f16|f128|int|uint|isize|usize|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' },
|
||||
{ token: 'variable.language.source.rust', regex: '\\bself\\b' },
|
||||
{ token: 'keyword.operator',
|
||||
regex: '!|\\$|\\*|\\-\\-|\\-|\\+\\+|\\+|-->|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|/=|%=|\\+=|\\-=|&=|\\^=|,|;' },
|
||||
@ -106,11 +102,11 @@ var RustHighlightRules = function() {
|
||||
{ token: 'meta.preprocessor.source.rust',
|
||||
regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b' },
|
||||
{ token: 'constant.numeric.integer.source.rust',
|
||||
regex: '\\b(?:[0-9][0-9_]*|[0-9][0-9_]*(?:u|u8|u16|u32|u64)|[0-9][0-9_]*(?:i|i8|i16|i32|i64))\\b' },
|
||||
regex: '\\b(?:[0-9][0-9_]*|[0-9][0-9_]*(?:u|us|u8|u16|u32|u64)|[0-9][0-9_]*(?:i|is|i8|i16|i32|i64))\\b' },
|
||||
{ token: 'constant.numeric.hex.source.rust',
|
||||
regex: '\\b(?:0x[a-fA-F0-9_]+|0x[a-fA-F0-9_]+(?:u|u8|u16|u32|u64)|0x[a-fA-F0-9_]+(?:i|i8|i16|i32|i64))\\b' },
|
||||
regex: '\\b(?:0x[a-fA-F0-9_]+|0x[a-fA-F0-9_]+(?:u|us|u8|u16|u32|u64)|0x[a-fA-F0-9_]+(?:i|is|i8|i16|i32|i64))\\b' },
|
||||
{ token: 'constant.numeric.binary.source.rust',
|
||||
regex: '\\b(?:0b[01_]+|0b[01_]+(?:u|u8|u16|u32|u64)|0b[01_]+(?:i|i8|i16|i32|i64))\\b' },
|
||||
regex: '\\b(?:0b[01_]+|0b[01_]+(?:u|us|u8|u16|u32|u64)|0b[01_]+(?:i|is|i8|i16|i32|i64))\\b' },
|
||||
{ token: 'constant.numeric.float.source.rust',
|
||||
regex: '[0-9][0-9_]*(?:f32|f64|f)|[0-9][0-9_]*[eE][+-]=[0-9_]+|[0-9][0-9_]*[eE][+-]=[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+|[0-9][0-9_]*\\.[0-9_]+(?:f32|f64|f)|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+|[0-9][0-9_]*\\.[0-9_]+%[eE][+-]=[0-9_]+(?:f32|f64|f)' },
|
||||
{ token: 'comment.line.documentation.source.rust',
|
||||
@ -137,10 +133,7 @@ var RustHighlightRules = function() {
|
||||
{ token: 'comment.end.block.source.rust',
|
||||
regex: '\\*/',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.block.source.rust' } ] } ],
|
||||
'#rust_escaped_character':
|
||||
[ { token: 'constant.character.escape.source.rust',
|
||||
regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)' } ] }
|
||||
{ defaultToken: 'comment.block.source.rust' } ] } ] }
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
13
node_modules/ace/lib/ace/mode/sql_highlight_rules.js
generated
vendored
13
node_modules/ace/lib/ace/mode/sql_highlight_rules.js
generated
vendored
@ -38,21 +38,28 @@ var SqlHighlightRules = function() {
|
||||
|
||||
var keywords = (
|
||||
"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
||||
"when|else|end|type|left|right|join|on|outer|desc|asc|union"
|
||||
"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" +
|
||||
"foreign|not|references|default|null|inner|cross|natural|database|drop|grant"
|
||||
);
|
||||
|
||||
var builtinConstants = (
|
||||
"true|false|null"
|
||||
"true|false"
|
||||
);
|
||||
|
||||
var builtinFunctions = (
|
||||
"count|min|max|avg|sum|rank|now|coalesce"
|
||||
);
|
||||
|
||||
var dataTypes = (
|
||||
"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
|
||||
"money|real|number|integer"
|
||||
);
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"support.function": builtinFunctions,
|
||||
"keyword": keywords,
|
||||
"constant.language": builtinConstants
|
||||
"constant.language": builtinConstants,
|
||||
"storage.type": dataTypes
|
||||
}, "identifier", true);
|
||||
|
||||
this.$rules = {
|
||||
|
||||
55
node_modules/ace/lib/ace/mode/sqlserver.js
generated
vendored
Normal file
55
node_modules/ace/lib/ace/mode/sqlserver.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/* ***** 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";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var SqlServerHighlightRules = require("./sqlserver_highlight_rules").SqlHighlightRules;
|
||||
var Range = require("../range").Range;
|
||||
var SqlServerFoldMode = require("./folding/sqlserver").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.HighlightRules = SqlServerHighlightRules;
|
||||
this.foldingRules = new SqlServerFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "--";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
|
||||
this.$id = "ace/mode/sql";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
||||
});
|
||||
224
node_modules/ace/lib/ace/mode/sqlserver_highlight_rules.js
generated
vendored
Normal file
224
node_modules/ace/lib/ace/mode/sqlserver_highlight_rules.js
generated
vendored
Normal file
@ -0,0 +1,224 @@
|
||||
/* ***** 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";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var SqlServerHighlightRules = function() {
|
||||
/**
|
||||
* Transact-SQL Syntax Conventions: https://msdn.microsoft.com/en-us/library/ms177563.aspx
|
||||
* Goal: make this imitate SSMS (SQL Server Managment Studio)
|
||||
*/
|
||||
|
||||
// https://msdn.microsoft.com/en-us/library/ms189773.aspx
|
||||
var logicalOperators = "ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|SOME";
|
||||
logicalOperators += "|NULL|IS|APPLY|INNER|OUTER|LEFT|RIGHT|JOIN|CROSS"; //SSMS colors these gray too
|
||||
//note: manually removed LEFT and RIGHT from built in functions below to color it same way SSMS does
|
||||
|
||||
|
||||
var builtinFunctions = (
|
||||
/* https://msdn.microsoft.com/en-us/library/ms187957.aspx */
|
||||
"OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms173454.aspx */
|
||||
"AVG|CHECKSUM_AGG|COUNT|COUNT_BIG|GROUPING|GROUPING_ID|MAX|MIN|STDEV|STDEVP|SUM|VAR|VARP|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms189798.aspx */
|
||||
"DENSE_RANK|NTILE|RANK|ROW_NUMBER" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms173823.aspx */
|
||||
"@@DATEFIRST|@@DBTS|@@LANGID|@@LANGUAGE|@@LOCK_TIMEOUT|@@MAX_CONNECTIONS|@@MAX_PRECISION|@@NESTLEVEL|@@OPTIONS|@@REMSERVER|@@SERVERNAME|@@SERVICENAME|@@SPID|@@TEXTSIZE|@@VERSION|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/hh231076.aspx */
|
||||
"CAST|CONVERT|PARSE|TRY_CAST|TRY_CONVERT|TRY_PARSE" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms186285.aspx */
|
||||
"@@CURSOR_ROWS|@@FETCH_STATUS|CURSOR_STATUS|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms186724.aspx */
|
||||
"@@DATEFIRST|@@LANGUAGE|CURRENT_TIMESTAMP|DATEADD|DATEDIFF|DATEFROMPARTS|DATENAME|DATEPART|DATETIME2FROMPARTS|DATETIMEFROMPARTS|DATETIMEOFFSETFROMPARTS|DAY|EOMONTH|GETDATE|GETUTCDATE|ISDATE|MONTH|SET DATEFIRST|SET DATEFORMAT|SET LANGUAGE|SMALLDATETIMEFROMPARTS|SP_HELPLANGUAGE|SWITCHOFFSET|SYSDATETIME|SYSDATETIMEOFFSET|SYSUTCDATETIME|TIMEFROMPARTS|TODATETIMEOFFSET|YEAR|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/hh213226.aspx */
|
||||
"CHOOSE|IIF|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms177516.aspx */
|
||||
"ABS|ACOS|ASIN|ATAN|ATN2|CEILING|COS|COT|DEGREES|EXP|FLOOR|LOG|LOG10|PI|POWER|RADIANS|RAND|ROUND|SIGN|SIN|SQRT|SQUARE|TAN|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms187812.aspx */
|
||||
"@@PROCID|APPLOCK_MODE|APPLOCK_TEST|APP_NAME|ASSEMBLYPROPERTY|COLUMNPROPERTY|COL_LENGTH|COL_NAME|DATABASEPROPERTYEX|DATABASE_PRINCIPAL_ID|DB_ID|DB_NAME|FILEGROUPPROPERTY|FILEGROUP_ID|FILEGROUP_NAME|FILEPROPERTY|FILE_ID|FILE_IDEX|FILE_NAME|FULLTEXTCATALOGPROPERTY|FULLTEXTSERVICEPROPERTY|INDEXKEY_PROPERTY|INDEXPROPERTY|INDEX_COL|OBJECTPROPERTY|OBJECTPROPERTYEX|OBJECT_DEFINITION|OBJECT_ID|OBJECT_NAME|OBJECT_SCHEMA_NAME|ORIGINAL_DB_NAME|PARSENAME|SCHEMA_ID|SCHEMA_NAME|SCOPE_IDENTITY|SERVERPROPERTY|STATS_DATE|TYPEPROPERTY|TYPE_ID|TYPE_NAME|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms186236.aspx */
|
||||
"CERTENCODED|CERTPRIVATEKEY|CURRENT_USER|DATABASE_PRINCIPAL_ID|HAS_PERMS_BY_NAME|IS_MEMBER|IS_ROLEMEMBER|IS_SRVROLEMEMBER|ORIGINAL_LOGIN|PERMISSIONS|PWDCOMPARE|PWDENCRYPT|SCHEMA_ID|SCHEMA_NAME|SESSION_USER|SUSER_ID|SUSER_NAME|SUSER_SID|SUSER_SNAME|SYS.FN_BUILTIN_PERMISSIONS|SYS.FN_GET_AUDIT_FILE|SYS.FN_MY_PERMISSIONS|SYSTEM_USER|USER_ID|USER_NAME|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms181984.aspx */
|
||||
"ASCII|CHAR|CHARINDEX|CONCAT|DIFFERENCE|FORMAT|LEN|LOWER|LTRIM|NCHAR|PATINDEX|QUOTENAME|REPLACE|REPLICATE|REVERSE|RTRIM|SOUNDEX|SPACE|STR|STUFF|SUBSTRING|UNICODE|UPPER|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms187786.aspx */
|
||||
"$PARTITION|@@ERROR|@@IDENTITY|@@PACK_RECEIVED|@@ROWCOUNT|@@TRANCOUNT|BINARY_CHECKSUM|CHECKSUM|CONNECTIONPROPERTY|CONTEXT_INFO|CURRENT_REQUEST_ID|ERROR_LINE|ERROR_MESSAGE|ERROR_NUMBER|ERROR_PROCEDURE|ERROR_SEVERITY|ERROR_STATE|FORMATMESSAGE|GETANSINULL|GET_FILESTREAM_TRANSACTION_CONTEXT|HOST_ID|HOST_NAME|ISNULL|ISNUMERIC|MIN_ACTIVE_ROWVERSION|NEWID|NEWSEQUENTIALID|ROWCOUNT_BIG|XACT_STATE|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms177520.aspx */
|
||||
"@@CONNECTIONS|@@CPU_BUSY|@@IDLE|@@IO_BUSY|@@PACKET_ERRORS|@@PACK_RECEIVED|@@PACK_SENT|@@TIMETICKS|@@TOTAL_ERRORS|@@TOTAL_READ|@@TOTAL_WRITE|FN_VIRTUALFILESTATS|" +
|
||||
/* https://msdn.microsoft.com/en-us/library/ms188353.aspx */
|
||||
"PATINDEX|TEXTPTR|TEXTVALID"
|
||||
);
|
||||
|
||||
|
||||
// https://msdn.microsoft.com/en-us/library/ms187752.aspx
|
||||
var dataTypes = ("BIGINT|BINARY|BIT|CHAR|CURSOR|DATE|DATETIME|DATETIME2|DATETIMEOFFSET|DECIMAL|FLOAT|HIERARCHYID|IMAGE|INTEGER|INT|MONEY|NCHAR|NTEXT|NUMERIC|NVARCHAR|REAL|SMALLDATETIME|SMALLINT|SMALLMONEY|SQL_VARIANT|TABLE|TEXT|TIME|TIMESTAMP|TINYINT|UNIQUEIDENTIFIER|VARBINARY|VARCHAR|XML");
|
||||
|
||||
|
||||
//https://msdn.microsoft.com/en-us/library/ms176007.aspx (these are lower case!)
|
||||
var builtInStoredProcedures = "sp_addextendedproc|sp_addextendedproperty|sp_addmessage|sp_addtype|sp_addumpdevice|sp_add_data_file_recover_suspect_db|sp_add_log_file_recover_suspect_db|sp_altermessage|sp_attach_db|sp_attach_single_file_db|sp_autostats|sp_bindefault|sp_bindrule|sp_bindsession|sp_certify_removable|sp_clean_db_file_free_space|sp_clean_db_free_space|sp_configure|sp_control_plan_guide|sp_createstats|sp_create_plan_guide|sp_create_plan_guide_from_handle|sp_create_removable|sp_cycle_errorlog|sp_datatype_info|sp_dbcmptlevel|sp_dbmmonitoraddmonitoring|sp_dbmmonitorchangealert|sp_dbmmonitorchangemonitoring|sp_dbmmonitordropalert|sp_dbmmonitordropmonitoring|sp_dbmmonitorhelpalert|sp_dbmmonitorhelpmonitoring|sp_dbmmonitorresults|sp_db_increased_partitions|sp_delete_backuphistory|sp_depends|sp_describe_first_result_set|sp_describe_undeclared_parameters|sp_detach_db|sp_dropdevice|sp_dropextendedproc|sp_dropextendedproperty|sp_dropmessage|sp_droptype|sp_execute|sp_executesql|sp_getapplock|sp_getbindtoken|sp_help|sp_helpconstraint|sp_helpdb|sp_helpdevice|sp_helpextendedproc|sp_helpfile|sp_helpfilegroup|sp_helpindex|sp_helplanguage|sp_helpserver|sp_helpsort|sp_helpstats|sp_helptext|sp_helptrigger|sp_indexoption|sp_invalidate_textptr|sp_lock|sp_monitor|sp_prepare|sp_prepexec|sp_prepexecrpc|sp_procoption|sp_recompile|sp_refreshview|sp_releaseapplock|sp_rename|sp_renamedb|sp_resetstatus|sp_sequence_get_range|sp_serveroption|sp_setnetname|sp_settriggerorder|sp_spaceused|sp_tableoption|sp_unbindefault|sp_unbindrule|sp_unprepare|sp_updateextendedproperty|sp_updatestats|sp_validname|sp_who|sys.sp_merge_xtp_checkpoint_files|sys.sp_xtp_bind_db_resource_pool|sys.sp_xtp_checkpoint_force_garbage_collection|sys.sp_xtp_control_proc_exec_stats|sys.sp_xtp_control_query_exec_stats|sys.sp_xtp_unbind_db_resource_pool";
|
||||
|
||||
|
||||
// https://msdn.microsoft.com/en-us/library/ms189822.aspx
|
||||
var keywords = "ABSOLUTE|ACTION|ADA|ADD|ADMIN|AFTER|AGGREGATE|ALIAS|ALL|ALLOCATE|ALTER|AND|ANY|ARE|ARRAY|AS|ASC|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|ATOMIC|AUTHORIZATION|BACKUP|BEFORE|BEGIN|BETWEEN|BIT_LENGTH|BLOB|BOOLEAN|BOTH|BREADTH|BREAK|BROWSE|BULK|BY|CALL|CALLED|CARDINALITY|CASCADE|CASCADED|CASE|CATALOG|CHARACTER|CHARACTER_LENGTH|CHAR_LENGTH|CHECK|CHECKPOINT|CLASS|CLOB|CLOSE|CLUSTERED|COALESCE|COLLATE|COLLATION|COLLECT|COLUMN|COMMIT|COMPLETION|COMPUTE|CONDITION|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONSTRUCTOR|CONTAINS|CONTAINSTABLE|CONTINUE|CORR|CORRESPONDING|COVAR_POP|COVAR_SAMP|CREATE|CROSS|CUBE|CUME_DIST|CURRENT|CURRENT_CATALOG|CURRENT_DATE|CURRENT_DEFAULT_TRANSFORM_GROUP|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|CURRENT_TIME|CURRENT_TRANSFORM_GROUP_FOR_TYPE|CYCLE|DATA|DATABASE|DBCC|DEALLOCATE|DEC|DECLARE|DEFAULT|DEFERRABLE|DEFERRED|DELETE|DENY|DEPTH|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISK|DISTINCT|DISTRIBUTED|DOMAIN|DOUBLE|DROP|DUMP|DYNAMIC|EACH|ELEMENT|ELSE|END|END-EXEC|EQUALS|ERRLVL|ESCAPE|EVERY|EXCEPT|EXCEPTION|EXEC|EXECUTE|EXISTS|EXIT|EXTERNAL|EXTRACT|FETCH|FILE|FILLFACTOR|FILTER|FIRST|FOR|FOREIGN|FORTRAN|FOUND|FREE|FREETEXT|FREETEXTTABLE|FROM|FULL|FULLTEXTTABLE|FUNCTION|FUSION|GENERAL|GET|GLOBAL|GO|GOTO|GRANT|GROUP|HAVING|HOLD|HOLDLOCK|HOST|HOUR|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IGNORE|IMMEDIATE|IN|INCLUDE|INDEX|INDICATOR|INITIALIZE|INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INTEGER|INTERSECT|INTERSECTION|INTERVAL|INTO|IS|ISOLATION|ITERATE|JOIN|KEY|KILL|LANGUAGE|LARGE|LAST|LATERAL|LEADING|LESS|LEVEL|LIKE|LIKE_REGEX|LIMIT|LINENO|LN|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATOR|MAP|MATCH|MEMBER|MERGE|METHOD|MINUTE|MOD|MODIFIES|MODIFY|MODULE|MULTISET|NAMES|NATIONAL|NATURAL|NCLOB|NEW|NEXT|NO|NOCHECK|NONCLUSTERED|NONE|NORMALIZE|NOT|NULL|NULLIF|OBJECT|OCCURRENCES_REGEX|OCTET_LENGTH|OF|OFF|OFFSETS|OLD|ON|ONLY|OPEN|OPERATION|OPTION|OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVER|OVERLAPS|OVERLAY|PAD|PARAMETER|PARAMETERS|PARTIAL|PARTITION|PASCAL|PATH|PERCENT|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PIVOT|PLAN|POSITION|POSITION_REGEX|POSTFIX|PRECISION|PREFIX|PREORDER|PREPARE|PRESERVE|PRIMARY|PRINT|PRIOR|PRIVILEGES|PROC|PROCEDURE|PUBLIC|RAISERROR|RANGE|READ|READS|READTEXT|RECONFIGURE|RECURSIVE|REF|REFERENCES|REFERENCING|REGR_AVGX|REGR_AVGY|REGR_COUNT|REGR_INTERCEPT|REGR_R2|REGR_SLOPE|REGR_SXX|REGR_SXY|REGR_SYY|RELATIVE|RELEASE|REPLICATION|RESTORE|RESTRICT|RESULT|RETURN|RETURNS|REVERT|REVOKE|ROLE|ROLLBACK|ROLLUP|ROUTINE|ROW|ROWCOUNT|ROWGUIDCOL|ROWS|RULE|SAVE|SAVEPOINT|SCHEMA|SCOPE|SCROLL|SEARCH|SECOND|SECTION|SECURITYAUDIT|SELECT|SEMANTICKEYPHRASETABLE|SEMANTICSIMILARITYDETAILSTABLE|SEMANTICSIMILARITYTABLE|SENSITIVE|SEQUENCE|SESSION|SET|SETS|SETUSER|SHUTDOWN|SIMILAR|SIZE|SOME|SPECIFIC|SPECIFICTYPE|SQL|SQLCA|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNING|START|STATE|STATEMENT|STATIC|STATISTICS|STDDEV_POP|STDDEV_SAMP|STRUCTURE|SUBMULTISET|SUBSTRING_REGEX|SYMMETRIC|SYSTEM|TABLESAMPLE|TEMPORARY|TERMINATE|TEXTSIZE|THAN|THEN|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOP|TRAILING|TRAN|TRANSACTION|TRANSLATE|TRANSLATE_REGEX|TRANSLATION|TREAT|TRIGGER|TRIM|TRUNCATE|TSEQUAL|UESCAPE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARIABLE|VARYING|VAR_POP|VAR_SAMP|VIEW|WAITFOR|WHEN|WHENEVER|WHERE|WHILE|WIDTH_BUCKET|WINDOW|WITH|WITHIN|WITHIN GROUP|WITHOUT|WORK|WRITE|WRITETEXT|XMLAGG|XMLATTRIBUTES|XMLBINARY|XMLCAST|XMLCOMMENT|XMLCONCAT|XMLDOCUMENT|XMLELEMENT|XMLEXISTS|XMLFOREST|XMLITERATE|XMLNAMESPACES|XMLPARSE|XMLPI|XMLQUERY|XMLSERIALIZE|XMLTABLE|XMLTEXT|XMLVALIDATE|ZONE";
|
||||
|
||||
|
||||
// Microsoft's keyword list is missing a lot of things that are located on various other pages
|
||||
// https://msdn.microsoft.com/en-us/library/ms187373.aspx, https://msdn.microsoft.com/en-us/library/ms181714.aspx
|
||||
keywords += "|KEEPIDENTITY|KEEPDEFAULTS|IGNORE_CONSTRAINTS|IGNORE_TRIGGERS|XLOCK|FORCESCAN|FORCESEEK|HOLDLOCK|NOLOCK|NOWAIT|PAGLOCK|READCOMMITTED|READCOMMITTEDLOCK|READPAST|READUNCOMMITTED|REPEATABLEREAD|ROWLOCK|SERIALIZABLE|SNAPSHOT|SPATIAL_WINDOW_MAX_CELLS|TABLOCK|TABLOCKX|UPDLOCK|XLOCK|IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX|EXPAND|VIEWS|FAST|FORCE|KEEP|KEEPFIXED|MAXDOP|MAXRECURSION|OPTIMIZE|PARAMETERIZATION|SIMPLE|FORCED|RECOMPILE|ROBUST|PLAN|SPATIAL_WINDOW_MAX_CELLS|NOEXPAND|HINT";
|
||||
// https://msdn.microsoft.com/en-us/library/ms173815.aspx
|
||||
keywords += "|LOOP|HASH|MERGE|REMOTE";
|
||||
// https://msdn.microsoft.com/en-us/library/ms175976.aspx
|
||||
keywords += "|TRY|CATCH|THROW";
|
||||
// highlighted words in SSMS that I'm not even sure where they come from
|
||||
keywords += "|TYPE";
|
||||
|
||||
|
||||
//remove any other built in things from key word list
|
||||
keywords = keywords.split('|');
|
||||
keywords = keywords.filter(function(value, index, self) {
|
||||
return logicalOperators.split('|').indexOf(value) === -1 && builtinFunctions.split('|').indexOf(value) === -1 && dataTypes.split('|').indexOf(value) === -1;
|
||||
});
|
||||
keywords = keywords.sort().join('|');
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"constant.language": logicalOperators,
|
||||
"storage.type": dataTypes,
|
||||
"support.function": builtinFunctions,
|
||||
"support.storedprocedure": builtInStoredProcedures,
|
||||
"keyword": keywords,
|
||||
}, "identifier", true);
|
||||
|
||||
|
||||
// createKeywordMapper ignores case which we want because SqlServer keywords are not case sensitive which causes our keywords to get changed to lowercase.
|
||||
// However, the preferred standard for keywords is uppercase, so this transforms them back to uppercase for code completion
|
||||
// EXCEPTION: build in stored procedures are lower case
|
||||
for (var i = 0; i < this.$keywordList.length; i++) {
|
||||
var keyword = this.$keywordList[i];
|
||||
if (builtInStoredProcedures.indexOf(keyword) !== -1) continue;
|
||||
this.$keywordList[i] = keyword.toUpperCase();
|
||||
}
|
||||
|
||||
|
||||
//https://msdn.microsoft.com/en-us/library/ms190356.aspx
|
||||
var setStatements = "SET ANSI_DEFAULTS|SET ANSI_NULLS|SET ANSI_NULL_DFLT_OFF|SET ANSI_NULL_DFLT_ON|SET ANSI_PADDING|SET ANSI_WARNINGS|SET ARITHABORT|SET ARITHIGNORE|SET CONCAT_NULL_YIELDS_NULL|SET CURSOR_CLOSE_ON_COMMIT|SET DATEFIRST|SET DATEFORMAT|SET DEADLOCK_PRIORITY|SET FIPS_FLAGGER|SET FMTONLY|SET FORCEPLAN|SET IDENTITY_INSERT|SET IMPLICIT_TRANSACTIONS|SET LANGUAGE|SET LOCK_TIMEOUT|SET NOCOUNT|SET NOEXEC|SET NUMERIC_ROUNDABORT|SET OFFSETS|SET PARSEONLY|SET QUERY_GOVERNOR_COST_LIMIT|SET QUOTED_IDENTIFIER|SET REMOTE_PROC_TRANSACTIONS|SET ROWCOUNT|SET SHOWPLAN_ALL|SET SHOWPLAN_TEXT|SET SHOWPLAN_XML|SET STATISTICS IO|SET STATISTICS PROFILE|SET STATISTICS TIME|SET STATISTICS XML|SET TEXTSIZE|SET XACT_ABORT".split('|');
|
||||
var isolationLevels = "READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SNAPSHOP|SERIALIZABLE".split('|');
|
||||
for (var i = 0; i < isolationLevels.length; i++) {
|
||||
setStatements.push('SET TRANSACTION ISOLATION LEVEL ' + isolationLevels[i]);
|
||||
}
|
||||
//add set statements to keywordList for completions
|
||||
for (var i = 0; i < setStatements.length; i++) {
|
||||
this.$keywordList.push(setStatements[i]);
|
||||
}
|
||||
|
||||
|
||||
this.$rules = {
|
||||
start: [{
|
||||
token: "string.start",
|
||||
regex: "'",
|
||||
next: [{
|
||||
token: "constant.language.escape",
|
||||
regex: /\\'/
|
||||
}, {
|
||||
token: "string.end",
|
||||
next: "start",
|
||||
regex: "'"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
},
|
||||
DocCommentHighlightRules.getStartRule("doc-start"), {
|
||||
token: "comment",
|
||||
regex: "--.*$"
|
||||
}, {
|
||||
token: "comment",
|
||||
start: "/\\*",
|
||||
end: "\\*/"
|
||||
}, {
|
||||
token: "string", // ' string
|
||||
regex: "'.*?'"
|
||||
}, {
|
||||
token: "constant.numeric", // float
|
||||
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
}, {
|
||||
token: keywordMapper,
|
||||
regex: "@{0,2}[a-zA-Z_$][a-zA-Z0-9_$]*\\b" //up to 2 @symbols for some build in functions
|
||||
}, {
|
||||
token: "constant.class",
|
||||
regex: "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}, {
|
||||
//https://msdn.microsoft.com/en-us/library/ms174986.aspx
|
||||
token: "keyword.operator",
|
||||
regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|\\*"
|
||||
}, {
|
||||
token: "paren.lparen",
|
||||
regex: "[\\(]"
|
||||
}, {
|
||||
token: "paren.rparen",
|
||||
regex: "[\\)]"
|
||||
}, {
|
||||
token: "punctuation",
|
||||
regex: ",|;"
|
||||
}, {
|
||||
token: "text",
|
||||
regex: "\\s+"
|
||||
}],
|
||||
comment: [
|
||||
DocCommentHighlightRules.getTagRule(), {
|
||||
token: "comment",
|
||||
regex: "\\*\\/",
|
||||
next: "no_regex"
|
||||
}, {
|
||||
defaultToken: "comment",
|
||||
caseInsensitive: true
|
||||
}],
|
||||
};
|
||||
|
||||
//add each set statment as regex at top of rules so that they are processed first because they require multiple words
|
||||
//note, this makes the statements not match if they are not upper case.. which is not ideal but I don't know of an easy way to fix this
|
||||
for (var i = 0; i < setStatements.length; i++) {
|
||||
var statement = setStatements[i];
|
||||
this.$rules.start.unshift({
|
||||
token: "set.statement",
|
||||
regex: statement
|
||||
});
|
||||
}
|
||||
|
||||
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
oop.inherits(SqlServerHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.SqlHighlightRules = SqlServerHighlightRules;
|
||||
});
|
||||
43
node_modules/ace/lib/ace/mode/vbscript_highlight_rules.js
generated
vendored
43
node_modules/ace/lib/ace/mode/vbscript_highlight_rules.js
generated
vendored
@ -3,7 +3,7 @@
|
||||
*
|
||||
* 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
|
||||
@ -14,7 +14,7 @@
|
||||
* * 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
|
||||
@ -85,29 +85,35 @@ var VBScriptHighlightRules = function() {
|
||||
{
|
||||
token: "punctuation.definition.comment.asp",
|
||||
regex: "'|REM",
|
||||
next: "comment"
|
||||
next: "comment",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: [
|
||||
"keyword.control.asp"
|
||||
],
|
||||
regex: "\\b(?:If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b"
|
||||
regex: "\\b(?:If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "keyword.operator.asp",
|
||||
regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b"
|
||||
regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "storage.type.asp",
|
||||
regex: "Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo"
|
||||
regex: "Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "storage.modifier.asp",
|
||||
regex: "\\b(?:Private|Public|Default)\\b"
|
||||
regex: "\\b(?:Private|Public|Default)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "constant.language.asp",
|
||||
regex: "\\b(?:Empty|False|Nothing|Null|True)\\b"
|
||||
regex: "\\b(?:Empty|False|Nothing|Null|True)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "punctuation.definition.string.begin.asp",
|
||||
@ -122,23 +128,28 @@ var VBScriptHighlightRules = function() {
|
||||
},
|
||||
{
|
||||
token: "support.class.asp",
|
||||
regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b"
|
||||
regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "support.class.collection.asp",
|
||||
regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b"
|
||||
regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "support.constant.asp",
|
||||
regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b"
|
||||
regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "support.function.asp",
|
||||
regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b"
|
||||
regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: "support.function.event.asp",
|
||||
regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b"
|
||||
regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
// {
|
||||
// token: [
|
||||
@ -148,7 +159,8 @@ var VBScriptHighlightRules = function() {
|
||||
// },
|
||||
{
|
||||
token: "support.function.vb.asp",
|
||||
regex: "\\b(?:Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b"
|
||||
regex: "\\b(?:Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: [
|
||||
@ -158,7 +170,8 @@ var VBScriptHighlightRules = function() {
|
||||
},
|
||||
{
|
||||
token: "support.type.vb.asp",
|
||||
regex: "\\b(?:vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b"
|
||||
regex: "\\b(?:vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b",
|
||||
caseInsensitive: true
|
||||
},
|
||||
{
|
||||
token: [
|
||||
|
||||
2
node_modules/ace/lib/ace/mode/xml.js
generated
vendored
2
node_modules/ace/lib/ace/mode/xml.js
generated
vendored
@ -53,7 +53,7 @@ oop.inherits(Mode, TextMode);
|
||||
|
||||
this.blockComment = {start: "<!--", end: "-->"};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
|
||||
13
node_modules/ace/lib/ace/mode/xml_highlight_rules.js
generated
vendored
13
node_modules/ace/lib/ace/mode/xml_highlight_rules.js
generated
vendored
@ -35,6 +35,9 @@ var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var XmlHighlightRules = function(normalize) {
|
||||
|
||||
var tagRegex = "[a-zA-Z][-_a-zA-Z0-9]*";
|
||||
|
||||
this.$rules = {
|
||||
start : [
|
||||
{token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
|
||||
@ -44,7 +47,7 @@ var XmlHighlightRules = function(normalize) {
|
||||
},
|
||||
{
|
||||
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
|
||||
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
|
||||
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
|
||||
},
|
||||
{token : "comment.xml", regex : "<\\!--", next : "comment"},
|
||||
{
|
||||
@ -60,7 +63,7 @@ var XmlHighlightRules = function(normalize) {
|
||||
|
||||
xml_decl : [{
|
||||
token : "entity.other.attribute-name.decl-attribute-name.xml",
|
||||
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
||||
regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
|
||||
}, {
|
||||
token : "keyword.operator.decl-attribute-equals.xml",
|
||||
regex : "="
|
||||
@ -96,7 +99,7 @@ var XmlHighlightRules = function(normalize) {
|
||||
next: "pop"
|
||||
}, {
|
||||
token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
|
||||
regex : "(<\\!)([-_a-zA-Z0-9]+)",
|
||||
regex : "(<\\!)(" + tagRegex + ")",
|
||||
push : [{
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
@ -132,7 +135,7 @@ var XmlHighlightRules = function(normalize) {
|
||||
|
||||
tag : [{
|
||||
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
|
||||
regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
||||
regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
|
||||
next: [
|
||||
{include : "attributes"},
|
||||
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
|
||||
@ -166,7 +169,7 @@ var XmlHighlightRules = function(normalize) {
|
||||
|
||||
attributes: [{
|
||||
token : "entity.other.attribute-name.xml",
|
||||
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
||||
regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
|
||||
}, {
|
||||
token : "keyword.operator.attribute-equals.xml",
|
||||
regex : "="
|
||||
|
||||
7
node_modules/ace/lib/ace/snippets/lean.js
generated
vendored
Normal file
7
node_modules/ace/lib/ace/snippets/lean.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./lean.snippets");
|
||||
exports.scope = "lean";
|
||||
|
||||
});
|
||||
0
node_modules/ace/lib/ace/snippets/lean.snippets
generated
vendored
Normal file
0
node_modules/ace/lib/ace/snippets/lean.snippets
generated
vendored
Normal file
2
node_modules/ace/lib/ace/snippets/r.snippets
generated
vendored
2
node_modules/ace/lib/ace/snippets/r.snippets
generated
vendored
@ -47,7 +47,7 @@ snippet apply
|
||||
snippet lapply
|
||||
lapply(${1:list}, ${2:function})
|
||||
snippet sapply
|
||||
lapply(${1:list}, ${2:function})
|
||||
sapply(${1:list}, ${2:function})
|
||||
snippet vapply
|
||||
vapply(${1:list}, ${2:function}, ${3:type})
|
||||
snippet mapply
|
||||
|
||||
7
node_modules/ace/lib/ace/snippets/sqlserver.js
generated
vendored
Normal file
7
node_modules/ace/lib/ace/snippets/sqlserver.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./sqlserver.snippets");
|
||||
exports.scope = "sqlserver";
|
||||
|
||||
});
|
||||
56
node_modules/ace/lib/ace/snippets/sqlserver.snippets
generated
vendored
Normal file
56
node_modules/ace/lib/ace/snippets/sqlserver.snippets
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
# ISNULL
|
||||
snippet isnull
|
||||
ISNULL(${1:check_expression}, ${2:replacement_value})
|
||||
# FORMAT
|
||||
snippet format
|
||||
FORMAT(${1:value}, ${2:format})
|
||||
# CAST
|
||||
snippet cast
|
||||
CAST(${1:expression} AS ${2:data_type})
|
||||
# CONVERT
|
||||
snippet convert
|
||||
CONVERT(${1:data_type}, ${2:expression})
|
||||
# DATEPART
|
||||
snippet datepart
|
||||
DATEPART(${1:datepart}, ${2:date})
|
||||
# DATEDIFF
|
||||
snippet datediff
|
||||
DATEDIFF(${1:datepart}, ${2:startdate}, ${3:enddate})
|
||||
# DATEADD
|
||||
snippet dateadd
|
||||
DATEADD(${1:datepart}, ${2:number}, ${3:date})
|
||||
# DATEFROMPARTS
|
||||
snippet datefromparts
|
||||
DATEFROMPARTS(${1:year}, ${2:month}, ${3:day})
|
||||
# Create Procedure
|
||||
snippet createproc
|
||||
-- =============================================
|
||||
-- Author: ${1:Author}
|
||||
-- Create date: ${2:Date}
|
||||
-- Description: ${3:Description}
|
||||
-- =============================================
|
||||
CREATE PROCEDURE ${4:Procedure_Name}
|
||||
-- Add the parameters for the stored procedure here
|
||||
AS
|
||||
BEGIN
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
END
|
||||
GO
|
||||
# Create Scalar Function
|
||||
snippet createfn
|
||||
-- =============================================
|
||||
-- Author: ${1:Author}
|
||||
-- Create date: ${2:Date}
|
||||
-- Description: ${3:Description}
|
||||
-- =============================================
|
||||
CREATE FUNCTION ${4:Scalar_Function_Name}
|
||||
-- Add the parameters for the function here
|
||||
RETURNS ${5:Function_Data_Type}
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @Result ${5:Function_Data_Type}
|
||||
|
||||
END
|
||||
GO
|
||||
1
node_modules/ace/lib/ace/test/all_browser.js
generated
vendored
1
node_modules/ace/lib/ace/test/all_browser.js
generated
vendored
@ -25,7 +25,6 @@ var testNames = [
|
||||
"ace/keyboard/emacs_test",
|
||||
"ace/keyboard/keybinding_test",
|
||||
"ace/keyboard/vim_test",
|
||||
"ace/keyboard/vim2_test",
|
||||
"ace/layer/text_test",
|
||||
"ace/lib/event_emitter_test",
|
||||
"ace/mode/coffee/parser_test",
|
||||
|
||||
2
node_modules/ace/lib/ace/theme/clouds_midnight.css
generated
vendored
2
node_modules/ace/lib/ace/theme/clouds_midnight.css
generated
vendored
@ -48,7 +48,7 @@
|
||||
}
|
||||
|
||||
.ace-clouds-midnight .ace_invisible {
|
||||
color: #BFBFBF
|
||||
color: #666
|
||||
}
|
||||
|
||||
.ace-clouds-midnight .ace_keyword,
|
||||
|
||||
4
node_modules/ace/lib/ace/theme/cobalt.css
generated
vendored
4
node_modules/ace/lib/ace/theme/cobalt.css
generated
vendored
@ -5,7 +5,7 @@
|
||||
|
||||
.ace-cobalt .ace_print-margin {
|
||||
width: 1px;
|
||||
background: #011e3a
|
||||
background: #555555
|
||||
}
|
||||
|
||||
.ace-cobalt {
|
||||
@ -131,4 +131,4 @@
|
||||
|
||||
.ace-cobalt .ace_indent-guide {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y
|
||||
}
|
||||
}
|
||||
|
||||
8
node_modules/ace/lib/ace/theme/github.css
generated
vendored
8
node_modules/ace/lib/ace/theme/github.css
generated
vendored
@ -68,9 +68,12 @@
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-github .ace_marker-layer .ace_active-line {
|
||||
.ace-github.ace_focus .ace_marker-layer .ace_active-line {
|
||||
background: rgb(255, 255, 204);
|
||||
}
|
||||
.ace-github .ace_marker-layer .ace_active-line {
|
||||
background: rgb(245, 245, 245);
|
||||
}
|
||||
|
||||
.ace-github .ace_marker-layer .ace_selection {
|
||||
background: rgb(181, 213, 255);
|
||||
@ -106,7 +109,10 @@
|
||||
.ace-github .ace_marker-layer .ace_selected-word {
|
||||
background: rgb(250, 250, 255);
|
||||
border: 1px solid rgb(200, 200, 250);
|
||||
}
|
||||
|
||||
.ace-github .ace_invisible {
|
||||
color: #BFBFBF
|
||||
}
|
||||
|
||||
.ace-github .ace_print-margin {
|
||||
|
||||
140
node_modules/ace/lib/ace/theme/iplastic.css
generated
vendored
Normal file
140
node_modules/ace/lib/ace/theme/iplastic.css
generated
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
.ace-iplastic .ace_gutter {
|
||||
background: #dddddd;
|
||||
color: #666666
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_print-margin {
|
||||
width: 1px;
|
||||
background: #bbbbbb
|
||||
}
|
||||
|
||||
.ace-iplastic {
|
||||
background-color: #eeeeee;
|
||||
color: #333333
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_cursor {
|
||||
color: #333
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_marker-layer .ace_selection {
|
||||
background: #BAD6FD;
|
||||
}
|
||||
|
||||
.ace-iplastic.ace_multiselect .ace_selection.ace_start {
|
||||
border-radius: 4px
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_marker-layer .ace_step {
|
||||
background: #444444
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_marker-layer .ace_bracket {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid #49483E;
|
||||
background: #FFF799
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_marker-layer .ace_active-line {
|
||||
background: #e5e5e5
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_gutter-active-line {
|
||||
background-color: #eeeeee
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_marker-layer .ace_selected-word {
|
||||
border: 1px solid #555555;
|
||||
border-radius:4px
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_invisible {
|
||||
color: #999999
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_entity.ace_name.ace_tag,
|
||||
.ace-iplastic .ace_keyword,
|
||||
.ace-iplastic .ace_meta.ace_tag,
|
||||
.ace-iplastic .ace_storage {
|
||||
color: #0000FF
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_punctuation,
|
||||
.ace-iplastic .ace_punctuation.ace_tag {
|
||||
color: #000
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_constant {
|
||||
color: #333333;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_constant.ace_character,
|
||||
.ace-iplastic .ace_constant.ace_language,
|
||||
.ace-iplastic .ace_constant.ace_numeric,
|
||||
.ace-iplastic .ace_constant.ace_other {
|
||||
color: #0066FF;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_constant.ace_numeric{
|
||||
font-weight: 100
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_invalid {
|
||||
color: #F8F8F0;
|
||||
background-color: #F92672
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_invalid.ace_deprecated {
|
||||
color: #F8F8F0;
|
||||
background-color: #AE81FF
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_support.ace_constant,
|
||||
.ace-iplastic .ace_support.ace_function {
|
||||
color: #333333;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_fold {
|
||||
background-color: #464646;
|
||||
border-color: #F8F8F2
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_storage.ace_type,
|
||||
.ace-iplastic .ace_support.ace_class,
|
||||
.ace-iplastic .ace_support.ace_type {
|
||||
color: #3333fc;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_entity.ace_name.ace_function,
|
||||
.ace-iplastic .ace_entity.ace_other,
|
||||
.ace-iplastic .ace_entity.ace_other.ace_attribute-name,
|
||||
.ace-iplastic .ace_variable {
|
||||
color: #3366cc;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_variable.ace_parameter {
|
||||
font-style: italic;
|
||||
color: #2469E0
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_string {
|
||||
color: #a55f03
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_comment {
|
||||
color: #777777;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_fold-widget {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==);
|
||||
}
|
||||
|
||||
.ace-iplastic .ace_indent-guide {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAABlJREFUeNpi+P//PwMzMzPzfwAAAAD//wMAGRsECSML/RIAAAAASUVORK5CYII=) right repeat-y
|
||||
}
|
||||
40
node_modules/ace/lib/ace/theme/iplastic.js
generated
vendored
Normal file
40
node_modules/ace/lib/ace/theme/iplastic.js
generated
vendored
Normal file
@ -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) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-iplastic";
|
||||
exports.cssText = require("../requirejs/text!./iplastic.css");
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
4
node_modules/ace/lib/ace/theme/katzenmilch.css
generated
vendored
4
node_modules/ace/lib/ace/theme/katzenmilch.css
generated
vendored
@ -55,6 +55,10 @@
|
||||
border: 1px solid rgba(100, 5, 208, 0.27)
|
||||
}
|
||||
|
||||
.ace-katzenmilch .ace_invisible {
|
||||
color: #BFBFBF
|
||||
}
|
||||
|
||||
.ace-katzenmilch .ace_fold {
|
||||
background-color: rgba(2, 95, 73, 0.97);
|
||||
border-color: rgba(15, 0, 9, 1.0)
|
||||
|
||||
4
node_modules/ace/lib/ace/theme/kuroir.css
generated
vendored
4
node_modules/ace/lib/ace/theme/kuroir.css
generated
vendored
@ -49,6 +49,10 @@
|
||||
border: 1px solid rgba(245, 170, 0, 0.57);
|
||||
}
|
||||
|
||||
.ace-kuroir .ace_invisible {
|
||||
color: #BFBFBF
|
||||
}
|
||||
|
||||
.ace-kuroir .ace_fold {
|
||||
border-color: #363636;
|
||||
}
|
||||
|
||||
171
node_modules/ace/lib/ace/theme/sqlserver.css
generated
vendored
Normal file
171
node_modules/ace/lib/ace/theme/sqlserver.css
generated
vendored
Normal file
@ -0,0 +1,171 @@
|
||||
.ace_line {
|
||||
font-family: Consolas;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_gutter {
|
||||
background: #ebebeb;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_print-margin {
|
||||
width: 1px;
|
||||
background: #e8e8e8;
|
||||
}
|
||||
|
||||
.ace-sqlserver {
|
||||
background-color: #FFFFFF;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_identifier {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_keyword {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_numeric {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_storage {
|
||||
color: #11B7BE;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_keyword.ace_operator,
|
||||
.ace-sqlserver .ace_lparen,
|
||||
.ace-sqlserver .ace_rparen,
|
||||
.ace-sqlserver .ace_punctuation {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_set.ace_statement {
|
||||
color: #0000FF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_cursor {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_invisible {
|
||||
color: rgb(191, 191, 191);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_constant.ace_buildin {
|
||||
color: rgb(88, 72, 246);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_constant.ace_language {
|
||||
color: #979797;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_constant.ace_library {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_invalid {
|
||||
background-color: rgb(153, 0, 0);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_support.ace_function {
|
||||
color: #FF00FF;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_support.ace_constant {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_class {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_support.ace_other {
|
||||
color: #6D79DE;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_variable.ace_parameter {
|
||||
font-style: italic;
|
||||
color: #FD971F;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_comment {
|
||||
color: #008000;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_constant.ace_numeric {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_variable {
|
||||
color: rgb(49, 132, 149);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_xml-pe {
|
||||
color: rgb(104, 104, 91);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_support.ace_storedprocedure {
|
||||
color: #800000;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_heading {
|
||||
color: rgb(12, 7, 255);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_list {
|
||||
color: rgb(185, 6, 144);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_selection {
|
||||
background: rgb(181, 213, 255);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_step {
|
||||
background: rgb(252, 255, 0);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_stack {
|
||||
background: rgb(164, 229, 101);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_bracket {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid rgb(192, 192, 192);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_active-line {
|
||||
background: rgba(0, 0, 0, 0.07);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_gutter-active-line {
|
||||
background-color: #dcdcdc;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_marker-layer .ace_selected-word {
|
||||
background: rgb(250, 250, 255);
|
||||
border: 1px solid rgb(200, 200, 250);
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_meta.ace_tag {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_string.ace_regex {
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_string {
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_entity.ace_other.ace_attribute-name {
|
||||
color: #994409;
|
||||
}
|
||||
|
||||
.ace-sqlserver .ace_indent-guide {
|
||||
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
||||
}
|
||||
39
node_modules/ace/lib/ace/theme/sqlserver.js
generated
vendored
Normal file
39
node_modules/ace/lib/ace/theme/sqlserver.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/* ***** 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) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-sqlserver";
|
||||
exports.cssText = require("../requirejs/text!./sqlserver.css");
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
5
node_modules/ace/lib/ace/virtual_renderer.js
generated
vendored
5
node_modules/ace/lib/ace/virtual_renderer.js
generated
vendored
@ -46,7 +46,7 @@ var FontMetrics = require("./layer/font_metrics").FontMetrics;
|
||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||
var editorCss = require("./requirejs/text!./css/editor.css");
|
||||
|
||||
dom.importCssString(editorCss, "ace_editor");
|
||||
dom.importCssString(editorCss, "ace_editor.css");
|
||||
|
||||
/**
|
||||
* The class that is responsible for drawing everything you see on the screen!
|
||||
@ -375,6 +375,9 @@ var VirtualRenderer = function(container, theme) {
|
||||
|
||||
if (this.resizing)
|
||||
this.resizing = 0;
|
||||
// reset cached values on scrollbars, needs to be removed when switching to non-native scrollbars
|
||||
// see https://github.com/ajaxorg/ace/issues/2195
|
||||
this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;
|
||||
};
|
||||
|
||||
this.$updateCachedSize = function(force, gutterWidth, width, height) {
|
||||
|
||||
2
node_modules/ace/package.json
generated
vendored
2
node_modules/ace/package.json
generated
vendored
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ace",
|
||||
"description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"homepage": "http://github.com/ajaxorg/ace",
|
||||
"engines": {"node": ">= 0.6.0"},
|
||||
"author": "Fabian Jakobs <fabian@c9.io>",
|
||||
|
||||
7
node_modules/ace/tool/release.sh
generated
vendored
7
node_modules/ace/tool/release.sh
generated
vendored
@ -9,11 +9,16 @@ pause() {
|
||||
done
|
||||
}
|
||||
|
||||
read -p "enter version number for the build " VERSION_NUM
|
||||
|
||||
|
||||
cd `dirname $0`/..
|
||||
SOURCE=`pwd`
|
||||
|
||||
CUR_VERSION=`node -e 'console.log(require("./package.json").version)'`
|
||||
git --no-pager log --first-parent --oneline v$CUR_VERSION..master
|
||||
echo "current version is $CUR_VERSION"
|
||||
read -p "enter version number for the build " VERSION_NUM
|
||||
|
||||
node -e "
|
||||
var fs = require('fs');
|
||||
var version = '$VERSION_NUM';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user