Skip to content

From 0.28.7, TypeDoc drops comments for declarations with the same name, even if they're unrelated #3064

@pjeby

Description

@pjeby

Search terms

multiple declarations with a comment

Expected Behavior

In 0.28.6 and previous versions, a function and a type with the same name are treated as distinct symbols, each with its own comment.

Actual Behavior

In 0.28.7 and up, a warning is generated, e.g:

[warning] ErrorResult has multiple 
declarations with a comment. An arbitrary comment will be used        
[info] The comments for ErrorResult are declared at:
        ./src/results.ts:117       
        ./src/results.ts:50        

And both the ErrorResult type and function get pages in the documentation, but the same comment is applied to both, rather than each handling its own.

Steps to reproduce the bug

Excerpts from the file producing an error:

/**
 * A {@link JobResult} that indicates the job was ended via a throw() or other
 * error.
 *
 * @category Types and Interfaces
 */
export type ErrorResult    = UnhandledError | HandledError;

/**
 * Create an {@link ErrorResult} from an error
 *
 * @category Requests and Results
 */
export function ErrorResult(err: any): UnhandledError { return mkResult("throw", undefined, err); }

Environment

  • TypeDoc version: 0.28.7 - 0.28.16
  • TypeScript version: 5.4.5
  • Node.js version: 22.13.1
  • OS: Windows

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