My IDE is Zend Studio 8, which features a relatively basic perspective for JavaScript (similar to, if not the same as, the perspective in Eclipse PDT). In the application I'm working on, we extend a base object across multiple files, which has effectively killed the autocomplete functionality. See below for an example scenario...
// global.js
var App = {
objectA: {
method1: function() {},
method2: function() {}
},
objectB: {
method1: function() {},
method2: function() {}
}
};
// extend.js
App.Extend = {
anotherMethod: function() {}
};
In this scenario, typing App.
causes autocomplete to appear with objectA
and objectB
, but not Extend
. If I add Extend to the App variable in global.js, it will appear in the autocomplete, but not with anotherMethod. If I were to use var Extend = { /* code */ };
, autocomplete would work for the Extend
object, so the problem does not seem to be related to the fact that the code is extended across multiple files. Perhaps it is because a single object is being spread across multiple files...or something else.
Anyone have any ideas?