Skip to content

memberof does not cascade down to class members #591

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

Open
webOS101 opened this issue Nov 10, 2016 · 5 comments
Open

memberof does not cascade down to class members #591

webOS101 opened this issue Nov 10, 2016 · 5 comments
Labels

Comments

@webOS101
Copy link

With the following code:

/** @module module */

/**
 * @class Clazz
 * @memberof module
 */
class Clazz {
	/** Whatever */
	member = 7
}

The member member gets documented as a root-level item with "memberof": "Clazz",. It really should be a memberof module.Clazz. Adding an explicit memberof does allow it to generate the correct docs. This is possibly related to #417 but seems to be more an extension of the same problem. (I already think there's an open issue that @module should already imply that Clazz is a memberof module. If not, I'll be happy to create one)

@tmcw tmcw added the bug label Nov 23, 2016
@tmcw
Copy link
Member

tmcw commented Feb 24, 2017

Looks like this equivalent to a simpler case, like

/** a */
var a = {
  /** b */
  b: {
    /** c */
    c: {}
  }
};

Which produces

Which is obviously, embarrassingly wrong. The tree-construction step in hierarchy.js needs a serious rethink.

@bpatram
Copy link

bpatram commented Jun 9, 2017

@tmcw Do you know when/if you'll be able to get to this issue? It's blocking some efforts on my end when documenting a few libraries!

@tmcw
Copy link
Member

tmcw commented Jun 9, 2017

Hi @bpatram - I'm taking some time off from daily work on this project in order to see if any other contributors spring up. While I really enjoy working on this project, working on it solo is not sustainable for me. Which means - I'd happily review a PR and help out if you want to try and help! The linked source and the nesting refactor #732 would serve as an example for how this code needs to be improved.

Otherwise, I can't really offer any guess or estimate of when I would get to this issue, since I have many priorities, open source and otherwise. If this is very important to you, please consider contributing - this project will only succeed if the community helps.

@maciej-ka
Copy link
Contributor

I started debugging src/infer/membership.js to find a reason for this problem.

@maciej-ka
Copy link
Contributor

Seems that comment /** c */ doesn't fit to any of conditions in this inferMembership block, while comment /** b */ is handled by this case

I have two ideas for the solution, should send MR soon.

Plan A: add some recursion when checking conditions in inferMembership block

Plan B: inferMembership will probably assign something to comment as a result (perhaps comment["memberof]") and maybe it's possible to use that value assigned to comment /** b */ when processing comment /** c */ (however this would assume that comments are in some parent-child relation before calculating memberof, which I guess is not true).

Few maybes because I'm quite new to the project, but this shouldn't be hard to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants