Skip to content

Improve the discovery of the doc comment for symbol (or may be a symbol for a doc comment) #1752

@canonic-epicure

Description

@canonic-epicure

Search terms

Doc comment

Description

I'm using the excludeNotDocumented option to prevent symbols w/o documentation to appear in the docs.
Sometimes I need to document in the inline object type, for example for function arguments:

        elementPointIsReachable (
            target : ActionTarget, 
            options : { offset : ActionTargetOffset, allowChildren : boolean } | ActionTargetOffset, 
            description? : string
        )

The type of options argument appears as {} in the docs (this is expected, because of the excludeNotDocumented):
image

Now, to include them in the docs, I'm trying to provide a documentation for the properties:

        elementPointIsReachable (
            target : ActionTarget, options : { /** include */ offset : ActionTargetOffset, /** include */allowChildren : boolean } | ActionTargetOffset, description? : string
        )

The result, however, is the same:
image

To make it work, the doc comment needs to reside on the separate line, above the symbol:

        elementPointIsReachable (
            target : ActionTarget, options : {
                /** include */
                offset : ActionTargetOffset,
                /** include */
                allowChildren : boolean
            } | ActionTargetOffset, description? : string
        )

This produces:
image

Expected

I'd expect, that the exact location of the doc comment should be not significant. Under "doc comment" I mean a comment with leading double star: /** */. The doc comment should just precede the symbol it documents, whether on the same line, or on the next line.

Environment

  • Typedoc version: 0.22.6
  • TypeScript version: 4.4.0
  • Node.js version: 12.22
  • OS: Ubuntu 18.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions