marijnh/CodeMirror — pull request #1090 by iwehrman (2012-12-12 19:25:44+00:00)
Title: Iwehrman/issue 1089

Track global variables alongside locals in the parser state as suggested by @marijnh in marijnh/CodeMirror#1089, and additionally use the global variables for hinting. The coloring distinction between globals and locals is preserved.

I don't completely understand how the mode initializes the parserConfig variable, but I've tried to allow the new globalVars component of the parser state to be initialized in the same way as the localVars component. In the future, this initial configuration might be a more conservative way (if that's desired) to include a list of global objects in the list of hints besides looking for globals in the parser's own memory space.