Skip to content

Inconsistent method parsing #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arnog opened this issue Jun 15, 2017 · 2 comments
Closed

Inconsistent method parsing #813

arnog opened this issue Jun 15, 2017 · 2 comments

Comments

@arnog
Copy link

arnog commented Jun 15, 2017

Some instance methods do not seem to be recognized by the parser. I haven't been able to detect a precise patter, but there's an example below. I have found that in some cases adding the @instance and @memberof directives helped to solve this issue but not in the case below.

In the documentation generated by documentationjs, the Lexer.end() method is assigned a global scope, and not associated with either the Lexer class or the lexer module.

/**
 * @module lexer
 */

define(function() {

/**
 * @param {string} s 
 * @memberof lexer
 * @class Lexer
 */
function Lexer(s) {}

/**
 * @memberof Lexer
 * @instance
 */
Lexer.prototype.end = function() {}

return {}

})

Removing the @member lexer directive on Lexer() will result in the Lexer.end() instance being recognized, but then Lexer, of course, Lexer doesn't show as a member of the lexer module.

@tmcw
Copy link
Member

tmcw commented Jun 18, 2017

Hi Arno!

Looks like this is this reported issue, that memberof does not cascade down to other members. I can't test this right now entirely, but want to try

 * @memberof lexer.Lexer

Instead for the Lexer.prototype.end comment? Since the full namespace of Lexer is lexer.Lexer, a memberof reference to the complete name may work properly, and also aligns to how JSDoc works.

@arnog
Copy link
Author

arnog commented Jun 20, 2017

I see. OK, thanks for your help!

@arnog arnog closed this as completed Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants