ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Is the variables must in global scope could be analyze by terns? #149

Closed easyfrog closed 7 years ago

easyfrog commented 7 years ago

src/game.js var Game = function() {...};

.tern-project { "loadEagerly": [ "src/*.js" ] }

main.js var g = new Game(); g. there is no completion suggestion.

I must change the game.js from var Game = to window.Game = . then could get suggestion correct.

So is the variables must in global scope ?

easyfrog commented 7 years ago

OH.... when I remove "node" plugins then it works. so the var Game = is conflict to the node plugin?

marijnh commented 7 years ago

The node plugin isolates files into CommonJS modules, so they don't share a top scope.