Problems with JSDoc and @memberOf

I'm having a problem with getting IntelliJ 12.1.4 to recognize some JSDoc tags indicating the structure of a namespace object.  I have the following in one file:

/** @namespace My.NS */

namespace("My.NS", function() {

      return {

          /** @memberOf My.NS */

          init: function(data) {

               // …

          }

      };

});

The namespace() function creates the global My.NS object structure and assigns the return value of the function to it.  In this case, the My.NS namespace has a single init() function, and it's explicitly documented as a member of My.NS.

In another file, I try to access it:

My.NS.init();

If I attempt to go to the declaration of the init() function, it brings up a list of all init functions IntelliJ can find in the project.  It also does not indicate that I'm incorrectly passing no arguments to a function that expects 1 argument.  It's interesting to note taking out the @memberOf annotation causes the syntax highlighting of "init" in My.NS.init() to changeIf I change the first file to the following, everything works fine.  Any ideas?

My.NS = {

      /** @memberOf My.NS */

     init: function(data) {

          // …

      }

};

1 comment

Hi Kyle,
Thanks for noticing! I've fixed it, logged as http://youtrack.jetbrains.com/issue/WEB-8528

Regards,
Konstantin

0

Please sign in to leave a comment.