Skip to content
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

Constructor property parameters are not documented when --excludeNotDocumented is on #1261

Closed
judax opened this issue Apr 7, 2020 · 8 comments
Labels
bug Functionality does not match expectation

Comments

@judax
Copy link

judax commented Apr 7, 2020

Search Terms

constructor parameter property documentation

Problem

When using --excludeNotDocumented, a class that declares properties in the constructor the properties do not seem to be documented correctly even with @param.

class X {
  /**
   * Instantiates X.
   * @param prop The property of X.
   */
  constructor(readonly prop: number) {
  }
}

Suggested Solution

@judax judax added the enhancement Improved functionality label Apr 7, 2020
@judax
Copy link
Author

judax commented Apr 7, 2020

This is not a suggestion, but a bug. Sorry for the wrong labelling.

@Gerrit0 Gerrit0 added bug Functionality does not match expectation and removed enhancement Improved functionality labels Apr 7, 2020
@Gerrit0 Gerrit0 changed the title Allow documenting constructor parameter properties Allow documenting constructor parameter properties with excludeNotDocumented Apr 7, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 7, 2020

@samuraijack you might be interested in this

@judax judax changed the title Allow documenting constructor parameter properties with excludeNotDocumented Constructor property parameters are not documented when --excludeNotDocumented is on Apr 7, 2020
@canonic-epicure
Copy link
Contributor

Thanks for the report, I'll check soon

@canonic-epicure
Copy link
Contributor

Can not reproduce this one. I'm testing with this class definition:

/**
 * Has docs
 */
export class BaseClass {
    /**
     * Has docs
     */
    some        : number
    // no docs
    protected kind: number;

    /**
     * Has docs
     */
    static instance: BaseClass;

    // no docs
    static instances: BaseClass[];

    /**
     * Has docs
     * @param name
     */
    constructor(readonly name: string){
    }
}

And the result is:
image

The constructor seems to be properly documented.

Command line:

node ../../bin/typedoc --includes inc/ --media media/ --target ES5 --json json.json --out doc/ src/ --excludeNotDocumented

@judax Any additional info?

@canonic-epicure
Copy link
Contributor

@judax Perhaps you did not include the docs for the class itself? Then the whole class won't be included.

@judax
Copy link
Author

judax commented Apr 23, 2020

Your test works but I still cannot make my code work:

/** Represents a 2 float structure (i.e. a point in 2D). */
export class Float2 {
  /**
   * Constructs a 2 float structure instance.
   *
   * @param x The x component of the 2 float structure.
   * @param y The y component of the 2 float structure.
   */
  constructor(readonly x: number, readonly y: number) {}
}

Here are my command line options:

typedoc --excludeNotDocumented --ignoreCompilerErrors --excludePrivate --excludeProtected --readme none --mode file --theme MY_DEFAULT_THEME_PATH

@canonic-epicure
Copy link
Contributor

Ok, thanks for the info!

@mdornseif
Copy link

Seems to me related to #584.

It also seems to me that there is no way to add Documentation to the auto-generated Properties (only the Parameters):

/** KvStore implements ...
*/
export class KvStore implements IKvStore {
  /** Generate a KvStore instance for a specific [[Datastore]] instance.
...
  @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.
  @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.
  */
  constructor(readonly datastore: Datastore, readonly projectId?: string) {
    assertIsObject(datastore)
  }

Generated Doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

4 participants