Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Also use context.receiver to assign methods and properties #77

Closed
wants to merge 1 commit into from

3 participants

Chema Balsas Randy Edmunds Lance Campbell
Chema Balsas
Owner

Hey @redmunds, @lkcampbell, this is a possible fix for #74. We were missing the receiver object, so we weren't pushing those properties and methods to the appropriate object.

Great catch! Thanks!

Randy Edmunds
Collaborator

@jbalsas I verified that the static methods are now showing up, but they are not distinguished from the instance methods in the API Docs. What about adding a static label for those?

@lkcampbell What do you think?

Lance Campbell

@redmunds, that sounds fine to me. My first concern is just getting the missing doc comments in there but it would also be nice to format them slightly different as well.

One idea would be to create a new section, before or after the Methods section, called Static Methods or Class Methods. Put the documentation for the methods in that new section. But if that is excessive, a static label would suffice.

Randy Edmunds
Collaborator

Yes, a separate section is even better.

Chema Balsas
Owner

Hi @redmunds, @lkcampbell

I'm a bit short on time these days, but still wanted to give this a go... I've created a new PR #80

The simplest fix for now is adding the STATIC modifier to those properties and methods. I didn't want to mess with the templates with so little time to double-check everything.

Could you please take a loot at the new PR? If you're okay with it, I can merge it and publish a new version so you can create the docs for 0.42

Chema Balsas jbalsas closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/language/js/ModuleParser.js
9 lib/language/js/ModuleParser.js
View
@@ -107,6 +107,7 @@
var context = comment.ctx;
if (context) {
+ var receiver = context.receiver || context.constructor;
if (context.type === "declaration") {
module.variables.push(comment);
@@ -127,11 +128,11 @@
}
- } else if (context.type === "method" && module.classes[context.constructor]) {
- module.classes[context.constructor].methods.push(comment);
+ } else if (context.type === "method" && module.classes[receiver]) {
+ module.classes[receiver].methods.push(comment);
- } else if (context.type === "property" && module.classes[context.constructor]) {
- module.classes[context.constructor].properties.push(comment);
+ } else if (context.type === "property" && module.classes[receiver]) {
+ module.classes[receiver].properties.push(comment);
}
} else {
Something went wrong with that request. Please try again.