Merge branch 'brackets' into glenn/file-system

Conflicts:
	src/document/DocumentManager.js
	src/language/JSUtils.js
	src/project/ProjectManager.js
	src/search/FindInFiles.js
This commit is contained in:
Ian Wehrman committed 2013-10-21 12:20:33 -07:00
commit bfb113d5a9
163 files changed
+4517 -3846

No files matched your search

@@ -26,13 +26,14 @@
define(function (require, exports, module) {
"use strict";
var _ = brackets.getModule("lodash");
var Commands = brackets.getModule("command/Commands"),
CommandManager = brackets.getModule("command/CommandManager"),
KeyEvent = brackets.getModule("utils/KeyEvent"),
Menus = brackets.getModule("command/Menus"),
Strings = brackets.getModule("strings"),
StringUtils = brackets.getModule("utils/StringUtils"),
HintsUtils2 = require("HintUtils2"),
ScopeManager = require("ScopeManager"),
Session = require("Session");
@@ -148,17 +149,17 @@ define(function (require, exports, module) {
function appendParameter(param, index) {
if (hints.currentIndex === index) {
$hintContent.append($("<span>")
.append(StringUtils.htmlEscape(param))
.append(_.escape(param))
.addClass("current-parameter"));
} else {
$hintContent.append(StringUtils.htmlEscape(param));
$hintContent.append(_.escape(param));
}
}
if (hints.parameters.length > 0) {
HintsUtils2.formatParameterHint(hints.parameters, appendSeparators, appendParameter);
} else {
$hintContent.append(StringUtils.htmlEscape(Strings.NO_ARGUMENTS));
$hintContent.append(_.escape(Strings.NO_ARGUMENTS));
}
}
@@ -34,10 +34,11 @@
define(function (require, exports, module) {
"use strict";
var _ = brackets.getModule("lodash");
var DocumentManager = brackets.getModule("document/DocumentManager"),
LanguageManager = brackets.getModule("language/LanguageManager"),
ProjectManager = brackets.getModule("project/ProjectManager"),
CollectionUtils = brackets.getModule("utils/CollectionUtils"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
FileSystem = brackets.getModule("filesystem/FileSystem"),
FileUtils = brackets.getModule("file/FileUtils"),
@@ -309,14 +310,14 @@ define(function (require, exports, module) {
var requests,
key = file + "@" + offset.line + "@" + offset.ch,
$deferredRequest;
if (CollectionUtils.hasProperty(pendingTernRequests, key)) {
if (_.has(pendingTernRequests, key)) {
requests = pendingTernRequests[key];
} else {
requests = {};
pendingTernRequests[key] = requests;
}
if (CollectionUtils.hasProperty(requests, type)) {
if (_.has(requests, type)) {
$deferredRequest = requests[type];
} else {
requests[type] = $deferredRequest = $.Deferred();
@@ -333,7 +334,7 @@ define(function (require, exports, module) {
*/
function getPendingRequest(file, offset, type) {
var key = file + "@" + offset.line + "@" + offset.ch;
if (CollectionUtils.hasProperty(pendingTernRequests, key)) {
if (_.has(pendingTernRequests, key)) {
var requests = pendingTernRequests[key],
requestType = requests[type];
@@ -26,6 +26,8 @@
define(function (require, exports, module) {
"use strict";
var _ = brackets.getModule("lodash");
var CodeHintManager = brackets.getModule("editor/CodeHintManager"),
EditorManager = brackets.getModule("editor/EditorManager"),
@@ -36,7 +38,6 @@ define(function (require, exports, module) {
AppInit = brackets.getModule("utils/AppInit"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
PerfUtils = brackets.getModule("utils/PerfUtils"),
StringUtils = brackets.getModule("utils/StringUtils"),
StringMatch = brackets.getModule("utils/StringMatch"),
LanguageManager = brackets.getModule("language/LanguageManager"),
ProjectManager = brackets.getModule("project/ProjectManager"),
@@ -131,10 +132,10 @@ define(function (require, exports, module) {
token.stringRanges.forEach(function (item) {
if (item.matched) {
$hintObj.append($("<span>")
.append(StringUtils.htmlEscape(item.text))
.append(_.escape(item.text))
.addClass("matched-hint"));
} else {
$hintObj.append(StringUtils.htmlEscape(item.text));
$hintObj.append(_.escape(item.text));
}
});
} else {
@@ -35,7 +35,7 @@ importScripts("thirdparty/requirejs/require.js");
MessageIds = messageIds;
HintUtils2 = hintUtils2;
var ternRequire = require.config({baseUrl: "./thirdparty"});
ternRequire(["tern/lib/tern", "tern/lib/infer", "tern/plugin/requirejs", "tern/plugin/doc_comment"], function (tern, infer, requirejs, docComment) {
ternRequire(["tern/lib/tern", "tern/lib/infer", "tern/plugin/requirejs", "tern/plugin/doc_comment", "tern/plugin/angular"], function (tern, infer, requirejs, docComment) {
Tern = tern;
Infer = infer;
@@ -86,7 +86,7 @@ importScripts("thirdparty/requirejs/require.js");
defs: env,
async: true,
getFile: getFile,
plugins: {requirejs: {}, doc_comment: true}
plugins: {requirejs: {}, doc_comment: true, angular: true}
};
ternServer = new Tern.Server(ternOptions);
@@ -185,7 +185,7 @@ define(function (require, exports, module) {
*/
function hintsAbsent(hintObj, absentHints) {
_waitForHints(hintObj, function (hintList) {
expect(hintList).not.toBeNull();
expect(hintList).toBeTruthy();
absentHints.forEach(function (absentHint) {
expect(_indexOf(hintList, absentHint)).toBe(-1);
});
@@ -203,7 +203,7 @@ define(function (require, exports, module) {
*/
function hintsPresent(hintObj, expectedHints) {
_waitForHints(hintObj, function (hintList) {
expect(hintList).not.toBeNull();
expect(hintList).toBeTruthy();
expectedHints.forEach(function (expectedHint) {
expect(_indexOf(hintList, expectedHint)).not.toBe(-1);
});
@@ -224,7 +224,7 @@ define(function (require, exports, module) {
currIndex;
_waitForHints(hintObj, function (hintList) {
expect(hintList).not.toBeNull();
expect(hintList).toBeTruthy();
expectedHints.forEach(function (expectedHint) {
currIndex = _indexOf(hintList, expectedHint);
expect(currIndex).toBeGreaterThan(prevIndex);
@@ -244,7 +244,7 @@ define(function (require, exports, module) {
*/
function hintsPresentExact(hintObj, expectedHints) {
_waitForHints(hintObj, function (hintList) {
expect(hintList).not.toBeNull();
expect(hintList).toBeTruthy();
expect(hintList.length).toBe(expectedHints.length);
expectedHints.forEach(function (expectedHint, index) {
expect(hintList[index].data("token").value).toBe(expectedHint);
@@ -282,9 +282,9 @@ define(function (require, exports, module) {
function selectHint(provider, hintObj, hintSelection) {
var hintList = expectHints(provider);
_waitForHints(hintObj, function (hintList) {
expect(hintList).not.toBeNull();
expect(hintList).toBeTruthy();
var index = findHint(hintList, hintSelection);
expect(hintList[index].data("token")).not.toBeNull();
expect(hintList[index].data("token")).toBeTruthy();
expect(provider.insertHint(hintList[index])).toBe(false);
});
}