Skip to content

Duplicate jsdoc tags from getters and setters #48801

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

Open
ST-DDT opened this issue Apr 21, 2022 · 2 comments
Open

Duplicate jsdoc tags from getters and setters #48801

ST-DDT opened this issue Apr 21, 2022 · 2 comments
Labels
Bug A bug in TypeScript Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented.
Milestone

Comments

@ST-DDT
Copy link

ST-DDT commented Apr 21, 2022

Bug Report

🔎 Search Terms

getter, setter, jsdocs, duplicated tags

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about duplicate tags
  • (Tested v4.0.5 + 4.6.2 + Nightly in https://www.typescriptlang.org/play)

⏯ Playground Link

https://www.typescriptlang.org/play?ts=4.0.5&ssl=29&ssc=4&pln=28&pc=10#code/KYDwDg9gTgLgBAYwDYEMDOa4BVhvgbwChC44B6AKgpNIrgBEI40IBbYZmAVwDMe4AFsCgcUAOhpxqpKXAACaYKIB2ATzgQYQqHHZaIAEwkzpteQeBgRCFDGAHsAgJaYXnKCmUBzDnl49jWjJJH3gQAAoASgAudydvOCIZOBFuKGU4AHIQTIBuGgBfYlJKU1lGZjZfbj5BYQ4AI0CpSTo5MBQPVjgQRw5lYAB3OAA3FCQuYGa2xRV1TW1dYH0jVtbzS2tbe0c3NzwPb2r-aeDSRTDwkFiD+K9IxMlECGUWJCmkCC8ryPzSIpodjwUViIwgTgcSRkZDIz1eEHeYk+3y0LjEIF+T1RaHRcAAvFkcn84ACCkA

💻 Code

export class Test {

  /**
   * Do some stuff here a.
   *
   * @see any other method.
   *
   * @deprecated This is strange stuff.
   */
   get x(): string {
    return 'x';
  }

  /**
   * Do some stuff here b.
   *
   * @param x The new value.
   * @see any other method.
   *
   * @deprecated This is strange stuff.
   */
  set x(x: string) {
    console.log(x);
  }

  test(): void {
    // console.log(this.x);
    this.x = 'a'; // Hover `x` to see the JsDocs
  }

}

🙁 Actual behavior

I see the jsdocs tags for both the getter and setter when hovering the property (usage) for them.

VSCode (v1.66.2) (Click to expand)

grafik

Stackblitz (TS-Sample) (Click to expand)

grafik

🙂 Expected behavior

I expect to see only the jsdocs for either the getter or setter, or at least duplicate tags being filtered.

See also

faker-js/faker#855 (comment)

@Shinigami92
I assume yes, feel free to link:

@ST-DDT ST-DDT changed the title Duplicate jsdoc tags for getters and setters Duplicate jsdoc tags from getters and setters Apr 21, 2022
@andrewbranch
Copy link
Member

@sandersn thoughts?

@sandersn sandersn added Bug A bug in TypeScript Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. labels Apr 25, 2022
@sandersn sandersn added this to the Backlog milestone Apr 25, 2022
@sandersn
Copy link
Member

#37451 only splits jsdoc correctly on get/set declarations themselves. Usages are still merged. It would be nice to split usage into get/set, but that's a lot harder to do correctly. This bug needs a proposal of how to make that happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented.
Projects
None yet
Development

No branches or pull requests

3 participants