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

Nested parameters description doesn't work with arrow functions #1003

Closed
1 task
jiri-vyc opened this issue Apr 1, 2019 · 3 comments
Closed
1 task

Nested parameters description doesn't work with arrow functions #1003

jiri-vyc opened this issue Apr 1, 2019 · 3 comments
Labels
bug Functionality does not match expectation

Comments

@jiri-vyc
Copy link

jiri-vyc commented Apr 1, 2019

Expected Behavior

TypeDoc should generate description for nested "options" parameter. E.g. options.first, options.second and options.third in options: { first: string, second: number, third: (a: number) => number }

Actual Behavior

Doesn't generate description for nested parameters. Only for the "options" object.

Steps to reproduce the bug

Code to document:

class Bar {
    /**
     * Test method with object param
     * @param options Describing the options param
     * @param options.first A description of the first property of the options param
     */
    public fooArrow = (options: { first?: string, second: number, third: (a: number) => number }) => {

    }
}

Typedoc command:
typedoc --out docs index.ts

Typedoc.json:

{
    "mode": "modules",
    "out": "docs"
}

Should generate documentation with description of option.first nested parameter, instead generates only for options.

It works perfectly well with the function written normally, but arrow notation doesn't work. I.e.:

class Bar {
    /**
     * Test method with object param
     * @param options Describing the options param
     * @param options.first A description of the first property of the options param
     */
    public fooArrow (options: { first?: string, second: number, third: (a: number) => number })  {

    }
}

generates

options: object
Describing the options param

Optional first?: undefined | string
A description of the first property of the options param

while

class Bar {
    /**
     * Test method with object param
     * @param options Describing the options param
     * @param options.first A description of the first property of the options param
     */
    public fooArrow = (options: { first?: string, second: number, third: (a: number) => number }) => {

    }
}

generates only

options: object
Describing the options param

Optional first?: undefined | string

Complete sample code to reproduce the bug and sample output documentation here: https://github.com/jiri-vyc/typedoc-test

(with comparison with standard and arrow function notation)

This is afaik not a duplicate of #987 nor #497

Environment

  • Typedoc version: 0.14.2
  • Node.js version: v10.15.1
  • OS: Windows 10 Pro
@jiri-vyc jiri-vyc added the bug Functionality does not match expectation label Apr 1, 2019
@fc
Copy link
Contributor

fc commented Apr 1, 2019

FYI, the repro ( jiri-vyc/typedoc-test ) is missing a package.json

@jiri-vyc
Copy link
Author

jiri-vyc commented Apr 2, 2019

@fc Added.

Also, I found an issue describing the same problem, including temporary workaround: #522, so this can be probably closed as duplicate.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 29, 2020

In 0.20, this appears to work as expected. The first codeblock generates this:

image

@Gerrit0 Gerrit0 closed this as completed Dec 29, 2020
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

3 participants