small changes for code review

This commit is contained in:
dloverin committed 2013-04-26 16:57:15 -04:00
1 parent 8fed6323fd
commit 3a22861211
3 files changed
+8 -14

No files matched your search

@@ -47,7 +47,7 @@ define(function (require, exports, module) {
var JUMPTO_DEFINITION = "navigate.jumptoDefinition";
var session = null, // object that encapsulates the current session state
cachedCursor = null, // last cursor of the current hinting session
cachedCursor = null, // last cursor of the current hinting session
cachedHints = null, // sorted hints for the current hinting session
cachedType = null, // describes the lookup type and the object context
cachedToken = null, // the token used in the current hinting session
@@ -196,7 +196,7 @@ define(function (require, exports, module) {
* Have conditions have changed enough to justify closing the hints popup?
*
* @param {Session} session - the active hinting session
* @return {Boolean} - true if the hints popup should be closed.
* @return {boolean} - true if the hints popup should be closed.
*/
JSHints.prototype.shouldCloseHints = function (session) {
@@ -218,12 +218,6 @@ define(function (require, exports, module) {
lastToken = session.getNextTokenOnLine(cachedCursor);
}
// if (token)
// console.log("token: " + token.className + " " + token.string);
//
// if (lastToken)
// console.log("last : " + lastToken.className + " " + lastToken.string);
// Both of the tokens should never be null (happens when token is off
// the end of the line), so one is null then close the hints.
if (!lastToken || !token ||
@@ -352,8 +346,7 @@ define(function (require, exports, module) {
delimiter;
if (token && token.string === ".") {
var nextCursor = session.getNextCursorOnLine(cursor),
nextToken = nextCursor ? session.getToken(nextCursor) : null;
var nextToken = session.getNextTokenOnLine(cursor);
if (nextToken && // don't replace delimiters, etc.
HintUtils.maybeIdentifier(nextToken.string) &&
@@ -149,13 +149,14 @@ define(function (require, exports, module) {
runs(function () { callback(hintList); });
}
/*
* Test if hints are close or not closed at a given position.
* Test if hints should be closed or not closed at a given position.
*
* @param {Object} provider - a CodeHintProvider object
* @param {Object + jQuery.Deferred} hintObj - a hint response object,
* possibly deferred
* @param {line, ch} - new position to move to after hints are received.
* @param {Boolean} expectedValue - true if hints should close,
* @param {line: number, ch: number} newPos - new position to move to
* after hints are received.
* @param {boolean} expectedValue - true if hints should close,
* false otherwise.
*/
function expectCloseHints(provider, hintObj, newPos, expectedValue) {