Skip to content

Commit a37002d

Browse files
iwehrmanmarijnh
authored andcommitted
use globals as well as locals in hinting
1 parent b03e998 commit a37002d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/util/javascript-hint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@
127127
}
128128
else {
129129
// If not, just look in the window object and any local scope
130-
// (reading into JS mode internals to get at the local variables)
130+
// (reading into JS mode internals to get at the local and global variables)
131131
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
132+
for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
132133
gatherCompletions(window);
133134
forEach(keywords, maybeAdd);
134135
}

0 commit comments

Comments
 (0)