tern
tern copied to clipboard
Tern not able to refer variables in other files
Apple.js
var apple = (function () {
return {
init : function() {
}
};
})();
AppleEater.js
//cant navigate from AppleEater.js to Apple.js, when either clicked on `apple` or `init`
apple.init();
Cant do the following as well
Apple.js
function Apple() {}
AppleEater.js
//cant navigate from AppleEater.js to Apple.js, when clicked on Apple
var apple = new Apple();
Do you have a module system plugin enabled, either in .tern-project or .tern-config?
I have used Eclipse, and added those scripts in the following preference=>javascript=>Tern=>Scriptpaths
Not sure if those would get created automatically
I'm also able to reproduce this;
it seems when using the webpack plugin with a reasonably deep folder structure (5 levels or so) tern refuses to load resolved files.
Debugging the webpack plugin, the resolve step occurs and correctly resolves the file that the referred symbol exists in, however tern doesn't seem to do anything with this.
By doing a files request, we can see that the referred file isn't loaded.
However, by turning on eager loading, this is resolved and tern has no issues resolving the symbol in the second file. Additionally, without eager loading this can be resolved by modifying the second file.
I will try get an example together to reproduce this functionality.
I would happily just use the loadEagerlyoption to fix my problems, however since the codebase I work on is so large, I am unable to eagerly load all files (hitting OS open file limits on tern bootup)
Example repo here:
https://github.com/nickw444/tern-demo. Readme explains how to reproduce.