Skip to content

Missing doc when returned field is not an object literal #2587

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

Closed
xixixao opened this issue Jun 8, 2024 · 1 comment
Closed

Missing doc when returned field is not an object literal #2587

xixixao opened this issue Jun 8, 2024 · 1 comment
Milestone

Comments

@xixixao
Copy link

xixixao commented Jun 8, 2024

Search terms

return fields properties

Expected Behavior

Input:

export function foo() {
  const x = {
    /**
     * This one is fine.
     */
    a: 1,
  };
  return {
    /**
     * This one is missing.
     */
    x,
  };
}

Output:

Includes both comments.

Actual Behavior

The This one is missing. comment is not included.

But note that TypeScript has no problem generating a correct declaration file with the comment:

export declare function foo(): {
    /**
     * This one is missing.
     */
    x: {
        /**
         * This one is fine.
         */
        a: number;
    };
};

Steps to reproduce the bug

As shown above.

Environment

  • Typedoc version: 0.25.13
  • TypeScript version: 5.0.4
  • Node.js version: 18.17.0
  • OS: macOS
@xixixao xixixao added the bug label Jun 8, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 9, 2024

I actually noticed + fixed this when investigating #2582, it's fixed in the latest beta

@Gerrit0 Gerrit0 added this to the v0.26.0 milestone Jun 9, 2024
@Gerrit0 Gerrit0 closed this as completed Jun 16, 2024
@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants