/** */ Style comments in code examples don't convert correctly

Offen
#64,961 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
documentation

Rechercherichtung

Start by tracing how TypeScript builds the documentation displayed in VS Code hover popups, then find the code that handles escaped characters in JavaDoc comments. Reproduce the reported case with the nested /** ... */ example and check whether \/ and \@ are displayed without their escape characters. Done when the popup output matches the expected example while ordinary comment parsing remains correct.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Possible Improvement
🔎 Search Terms

I'm trying to put a code example in a JavaDoc comment. However, the escaped characters show up as escape characters instead of the regular characters I'm trying to display. For example;

/**
  *  \/** comment in comment *\/
  */

Turns into

\/** comment in comment *\/

But should turn into;

/** comment in comment */
🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about javadocs.
⏯ Playground Link

No response

💻 Code

The input code


/**
 * @see {@link I_Trial} 
 * An API trial is a trial that should be used to test an API (expanded as an Application Programming Interface ).  
 * This could be an internal interface of a program, a public command-line interface between programs, or a RESTful or other web-based interface. 
 * In other words, this kind of trial is the catch-all when nother trial type does not seem appropriate for your tests use an ApiTrial. 
 * For example;
 * 
 * ```
 * import { I_Class} from '@ts.adligo.org/i_obj/dist/i_obj.mjs';
 * import { I_AssertionContext } from '@ts.adligo.org/i_tests4ts/dist/i_assertions.mjs';
 * import { I_Trial } from '@ts.adligo.org/i_tests4ts/dist/i_tests4ts.mjs';
 * import { ApiTrial} from '@ts.adligo.org/tests4ts/dist/trials.mjs';
 *
 * export class FooApiTrial extends ApiTrial {
 *   public static readonly CLASS_NAME = 'FooApiTrial';
 *   public static readonly CLAZZ_NAME = PROC_TESTS_PACKAGE_DOT + FooApiTrial.CLASS_NAME;
 *
 *   
*   \/** \@see {\@link I_Class} 
*     * Also note this fulll package and class name allows (Hudson, Jenkins) or Travis CI (continuous integration) tools
*     * the ability to group Trials and their tests by package and class name.  Hudson, Jenkins and Travis all have
*     * great JUnit results charts and drill down interfaces that tests4ts is integrated with.
*     *\/
 *   getClass(): string { return FooApiTrial.CLAZZ_NAME; }
 *   
 *   testSomethingCool(ac: I_AssertionContext) {
 *     ac.isTrue(false);
 *   }
 * }
 * ```
 * 
 * Note the example is copy and pasteable from the VSCode hover over (intellisence) javadoc popup.
*/

The expected output (intellisence popup in VS Code);

import { I_Class} from '@ts.adligo.org/i_obj/dist/i_obj.mjs';
import { I_AssertionContext } from '@ts.adligo.org/i_tests4ts/dist/i_assertions.mjs';
import { I_Trial } from '@ts.adligo.org/i_tests4ts/dist/i_tests4ts.mjs';
import { ApiTrial} from '@ts.adligo.org/tests4ts/dist/trials.mjs';

export class FooApiTrial extends ApiTrial {
  public static readonly CLASS_NAME = 'FooApiTrial';
  public static readonly CLAZZ_NAME = PROC_TESTS_PACKAGE_DOT + FooApiTrial.CLASS_NAME;


 /** @see {@link I_Class}
   * Also note this fulll package and class name allows (Hudson, Jenkins) or Travis CI (continuous integration) tools
   * the ability to group Trials and their tests by package and class name.  Hudson, Jenkins and Travis all have
   * great JUnit results charts and drill down interfaces that tests4ts is integrated with.
   */
  getClass(): string { return FooApiTrial.CLAZZ_NAME; }

  testSomethingCool(ac: I_AssertionContext) {
    ac.isTrue(false);
  }
}
🙁 Actual behavior

The current output (intellisence popup in VS Code);

import { I_Class} from '@ts.adligo.org/i_obj/dist/i_obj.mjs';
import { I_AssertionContext } from '@ts.adligo.org/i_tests4ts/dist/i_assertions.mjs';
import { I_Trial } from '@ts.adligo.org/i_tests4ts/dist/i_tests4ts.mjs';
import { ApiTrial} from '@ts.adligo.org/tests4ts/dist/trials.mjs';

export class FooApiTrial extends ApiTrial {
  public static readonly CLASS_NAME = 'FooApiTrial';
  public static readonly CLAZZ_NAME = PROC_TESTS_PACKAGE_DOT + FooApiTrial.CLASS_NAME;


 \/** \@see {\@link I_Class}
   * Also note this fulll package and class name allows (Hudson, Jenkins) or Travis CI (continuous integration) tools
   * the ability to group Trials and their tests by package and class name.  Hudson, Jenkins and Travis all have
   * great JUnit results charts and drill down interfaces that tests4ts is integrated with.
   *\/
  getClass(): string { return FooApiTrial.CLAZZ_NAME; }

  testSomethingCool(ac: I_AssertionContext) {
    ac.isTrue(false);
  }
}
🙂 Expected behavior

I don't expect to see the escape characters in the JavaDoc pop-up menu, i.e. I'm seeing '/' or '@' and want to see '/' or '@' respectively.

Additional information about the issue

No response

Vorherrschende Sprache
Go
Sterne
112k
Forks
15.4k
Ø Merge
2 T. 21 Std.
Gemergte PRs (30 T.)
126

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/TypeScript

Alle Issues in microsoft/TypeScript

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

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