Netbeans javascript documentation for autocomplete / code completion / intellisense

I use Netbeans 6.9 and 7 beta in Windows 7. According to Netbeans javascript documentation, you can add documentation to my project and get autocomplete on my classes and functions. The problem I am facing is that I am using my own class declaration (through a function called Class ) and cannot seem to get the job to work. For example, a simple class declaration would look like this:

 mySubClass = Class(parentClass, { memberVariable: null, /** * @class mySubClass * @constructor */ initialize: function(value) { this.memberVariable = value; }, /** * @class mySubClass */ getMV: function() { return this.memberVariable; }, /** * @class mySubClass */ setMV: function(value) { this.memberVariable = value; } }); 

I have tried many options and ad placements ( @class , @memberOf , etc.) but cannot complete the job. For example, after

 var testObj = new my 

I should get mySubClass by pressing "ctrl + space" and similarly going to:

 var test = new mySubClass(1); test. 

and get options for getMV and setMV . Is this possible, and if so, how can I do this? Thanks.

+7
source share
2 answers

I had the same problem. Perhaps your code was simplified, I had to read it twice to understand that the class is your own function, not the js syntax ..

 foo.canvas = function(id) { this.clear = function() {}; }; bar = foo.canvas("myCanvas"); bar. <-- here NetBeans doesn't suggest the "clear" function. 

NetBeans doesn't seem to do introspection in JS. This seems to work only for native and host objects.

Try Komodo Edit, it seems to be correct.

0
source

It should work with @lends (see JSDoc-toolkit CookBook ). It does not work in Netbeans 7.2, though (even @type and @link do not work).

0
source

All Articles