Skip to content

Commit

Permalink
use globals as well as locals in hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
iwehrman authored and marijnh committed Dec 13, 2012
1 parent 1bcc976 commit 426a389
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/util/javascript-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@
}
else {
// If not, just look in the window object and any local scope
// (reading into JS mode internals to get at the local variables)
// (reading into JS mode internals to get at the local and global variables)
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
gatherCompletions(window);
forEach(keywords, maybeAdd);
}
Expand Down

0 comments on commit 426a389

Please sign in to comment.