Skip to content

Duplicate jsdoc tags from getters and setters #48801

Open
@ST-DDT

Description

@ST-DDT

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions