microsoft / microsoft/TypeScript

Adding jsdoc to overriding method makes inherited jsdoc disappear

Offen
#43,506 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: JSDoc Needs Proposal Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

When adding doc to a class for API level, if we add more doc inside the implementation, we lost some documentation !
ex here, i add * @example $AA.method() and if i add tag @implement or any others in the childClass, we lost documentations from parent and for the API level.

This image show tag:@example $AA.method() is removed!, because we add more doc in AA.method !
image

The expected behavior should be look like this (push docs and no replace) .
Work only if we add in parent , but should work if we add in child class.
image

  • VS Code Version:
    Version : 1.55.0 (user setup)
    Commit : c185983a683d14c396952dd432459097bc7f757f
    Date : 2021-03-30T16:01:55.261Z
    Electron : 11.3.0
    Chrome : 87.0.4280.141
    Node.js : 12.18.3
    V8 : 8.7.220.31-electron.0
    OS : Windows_NT x64 10.0.19042

Steps to Reproduce:

Add doc to AA.method will remove some docs in the A.method

abstract class A {
	/**  `method` to be implement for the class AA
	 * @example $AA.method()
	 */
	abstract method(): any;
}

class AA extends A {
	/**
	 * @implements more info on the implementation
	 */
	method() {
		throw new Error('Method not implemented.');
	}
}

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das abstrakte A/AA-Beispiel in VS Code bei deaktivierten Erweiterungen und vergleiche die gerenderte Dokumentation für die geerbte Methode. Verfolge die Verarbeitung von JSDoc für überschriebene Methoden im TypeScript language-service und füge einen Regressionstest hinzu oder aktualisiere ihn, falls der relevante Testbereich gefunden wird. Als erledigt gilt, dass die Implementierungsdokumentation ergänzt wird, ohne geerbte Beispiele oder Text auf API-Ebene zu entfernen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.