mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Merge remote-tracking branch 'upstream/master' into pflynn/JakeStoeffler-languageselector-updated
This commit is contained in:
commit
b0a982ed43
92 files changed
+6455
-1265
No files matched your search
@@ -393,8 +393,8 @@ define(function (require, exports, module) {
|
||||
*/
|
||||
function installListeners(editor) {
|
||||
|
||||
$(editor).on("keyEvent", function (jqEvent, editor, event) {
|
||||
if (event.type === "keydown" && event.keyCode === KeyEvent.DOM_VK_ESCAPE) {
|
||||
$(editor).on("keydown", function (jqEvent, editor, event) {
|
||||
if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) {
|
||||
dismissHint();
|
||||
}
|
||||
}).on("scroll", function () {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
|
||||
/*global define, brackets, CodeMirror, $, Worker, setTimeout */
|
||||
/*global define, brackets, $, Worker, setTimeout */
|
||||
|
||||
define(function (require, exports, module) {
|
||||
"use strict";
|
||||
@@ -42,6 +42,7 @@ define(function (require, exports, module) {
|
||||
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
|
||||
FileSystem = brackets.getModule("filesystem/FileSystem"),
|
||||
FileUtils = brackets.getModule("file/FileUtils"),
|
||||
CodeMirror = brackets.getModule("thirdparty/CodeMirror2/lib/codemirror"),
|
||||
HintUtils = require("HintUtils"),
|
||||
MessageIds = require("MessageIds"),
|
||||
Preferences = require("Preferences");
|
||||
@@ -789,8 +790,8 @@ define(function (require, exports, module) {
|
||||
*/
|
||||
function findNameInProject() {
|
||||
// check for any files in project that end with the right path.
|
||||
var fileName = name.substring(name.lastIndexOf("/"));
|
||||
|
||||
var fileName = name.substring(name.lastIndexOf("/") + 1);
|
||||
|
||||
function _fileFilter(entry) {
|
||||
return entry.name === fileName;
|
||||
}
|
||||
@@ -1320,29 +1321,32 @@ define(function (require, exports, module) {
|
||||
* Track the update area of the current document so we can tell if we can send
|
||||
* partial updates to tern or not.
|
||||
*
|
||||
* @param {{from: {line:number, ch: number}, to: {line:number, ch: number},
|
||||
* text: Array<string>}} changeList - the document changes (since last change or cumlative?)
|
||||
* @param {Array.<{from: {line:number, ch: number}, to: {line:number, ch: number},
|
||||
* text: Array<string>}>} changeList - the document changes from the current change event
|
||||
*/
|
||||
function trackChange(changeList) {
|
||||
var changed = documentChanges;
|
||||
var changed = documentChanges, i;
|
||||
if (changed === null) {
|
||||
documentChanges = changed = {from: changeList.from.line, to: changeList.from.line};
|
||||
documentChanges = changed = {from: changeList[0].from.line, to: changeList[0].from.line};
|
||||
if (config.debug) {
|
||||
console.debug("ScopeManager: document has changed");
|
||||
}
|
||||
}
|
||||
|
||||
var end = changeList.from.line + (changeList.text.length - 1);
|
||||
if (changeList.from.line < changed.to) {
|
||||
changed.to = changed.to - (changeList.to.line - end);
|
||||
}
|
||||
for (i = 0; i < changeList.length; i++) {
|
||||
var thisChange = changeList[i],
|
||||
end = thisChange.from.line + (thisChange.text.length - 1);
|
||||
if (thisChange.from.line < changed.to) {
|
||||
changed.to = changed.to - (thisChange.to.line - end);
|
||||
}
|
||||
|
||||
if (end >= changed.to) {
|
||||
changed.to = end + 1;
|
||||
}
|
||||
if (end >= changed.to) {
|
||||
changed.to = end + 1;
|
||||
}
|
||||
|
||||
if (changed.from > changeList.from.line) {
|
||||
changed.from = changeList.from.line;
|
||||
if (changed.from > thisChange.from.line) {
|
||||
changed.from = thisChange.from.line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ define(function (require, exports, module) {
|
||||
// type has changed since the last hint computation
|
||||
if (this.needNewHints(session)) {
|
||||
if (key) {
|
||||
ScopeManager.handleFileChange({from: cursor, to: cursor, text: [key]});
|
||||
ScopeManager.handleFileChange([{from: cursor, to: cursor, text: [key]}]);
|
||||
ignoreChange = true;
|
||||
}
|
||||
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
|
||||
/*global define, $ */
|
||||
define(function (require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
function Cup() {
|
||||
this.empty = true;
|
||||
}
|
||||
|
||||
Cup.prototype.fill = function () {
|
||||
this.empty = false;
|
||||
};
|
||||
|
||||
Cup.prototype.emptyIt = function () {
|
||||
};
|
||||
|
||||
Cup.prototype.full = function () {
|
||||
};
|
||||
|
||||
Cup.prototype.empty = function () {
|
||||
};
|
||||
|
||||
exports.Cup = Cup;
|
||||
});
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
|
||||
/*global define, $ */
|
||||
define(function (require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var Cup = require('china/Cup').Cup;
|
||||
|
||||
var coffeeCup = new Cup(false);
|
||||
coffeeCup.
|
||||
});
|
||||
@@ -1806,6 +1806,32 @@ define(function (require, exports, module) {
|
||||
|
||||
});
|
||||
|
||||
describe("Code Hinting Regression", function () {
|
||||
var testFile = extensionPath + "/unittest-files/module-test-files/china/cupFiller.js";
|
||||
|
||||
beforeEach(function () {
|
||||
setupTest(testFile, true);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
tearDownTest();
|
||||
});
|
||||
|
||||
// The test is disabled, because the TernWorker will consult the ProjectManager to
|
||||
// determine all the files in the project root. We don't have a project root for this
|
||||
// testcase. Perhaps we need to change the testsetup or find another way of dealing with this
|
||||
// Test makes sure that http://github.com/adobe/brackets/issue/6931 doesn't show up
|
||||
xit("should show hints for members of referenced class", function () {
|
||||
var start = { line: 8, ch: 15 };
|
||||
|
||||
runs(function () {
|
||||
testEditor.setCursorPos(start);
|
||||
var hintObj = expectHints(JSCodeHints.jsHintProvider);
|
||||
hintsPresentExact(hintObj, ["empty", "emptyIt", "fill", "full"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("JavaScript Code Hinting format parameters tests", function () {
|
||||
|
||||
it("should format parameters with no params", function () {
|
||||
@@ -1859,7 +1885,5 @@ define(function (require, exports, module) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user