Skip to content

JSDoc @deprecated block tag should expand for all function overloads #44076

Closed
@rdsedmundo

Description

@rdsedmundo
  • VS Code Version: 1.56.1
  • OS Version: macOS Big Sur 11.3.1

Steps to Reproduce:

  1. Create two overloads for a function. Add a JSDoc @deprecated block tag on the first overload.
  2. For the first overload, VSCode will strike it correctly, but for the second it will not.

Does this issue occur when all extensions are disabled?: Yes

Example from Ramda package:

/**
 * Create a new object with the own properties of a
 * merged with the own properties of object b.
 * This function will *not* mutate passed-in objects.
 *
 * @deprecated since 0.26 in favor of mergeRight
 */
export function merge<O2 extends object>(__: Placeholder, b: O2): <O1 extends object>(a: O1) => Merge<O2, O1, 'flat'>;
export function merge(__: Placeholder): <O1 extends object, O2 extends object>(b: O2, a: O1) => Merge<O2, O1, 'flat'>;
export function merge<O1 extends object, O2 extends object>(a: O1, b: O2): Merge<O2, O1, 'flat'>;
export function merge<O1 extends object>(a: O1): <O2 extends object>(b: O2) => Merge<O2, O1, 'flat'>;

Here the strikethrough is applied correctly:
Screen Shot 2021-05-13 at 05 10 52

Here it's not:
Screen Shot 2021-05-13 at 05 11 00

From the quick info tooltip you can see that the @deprecated tag was read, but the strike wasn't applied.

I realize that an overload might be deprecated individually, but from this comment from @sandersn I understood that as of TypeScript 4.0 if the first overload is deprecated, then it would cascade, but I might have misunderstood what he said.

This might very well be an issue on TypeScript side in fact, as the (ts) error report is different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions