Skip to content

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

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
rdsedmundo opened this issue May 13, 2021 · 2 comments
Closed
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@rdsedmundo
Copy link

  • 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.

@rdsedmundo rdsedmundo changed the title JSDoc @deprecated block tag should expand for all overloads JSDoc @deprecated block tag should expand for all function overloads May 13, 2021
@mjbvz mjbvz transferred this issue from microsoft/vscode May 13, 2021
@mjbvz mjbvz removed their assignment May 13, 2021
@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label May 13, 2021
@RyanCavanaugh
Copy link
Member

This is the intended behavior, since you may want to deprecate some overloads but not others (this is in fact very common).

@sandersn
Copy link
Member

sandersn commented May 13, 2021

but from this comment from @sandersn I understood that as of TypeScript 4.0

That was actually 4.0 beta; by the full release the behaviour matched other jsdoc behaviour.

This is a subissue of #407, so let's continue the discussion over there. I believe the current thing missing is (1) a comprehensive proposal (2) that includes analysis of @inheritdoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants