Skip to content

Improper @example parsing when an at-sign @ is used in the code-block. #38922

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
JHawkley opened this issue Jun 3, 2020 · 3 comments
Closed
Labels
Bug A bug in TypeScript
Milestone

Comments

@JHawkley
Copy link

JHawkley commented Jun 3, 2020

Noticed an issue with the @example JSDoc tag when the example happens to use an @ sign, such as for an email address (my case).

  • VSCode Version: 1.45.1
  • OS Version: Ubuntu 20.04

Steps to Reproduce:

  1. Make an @example JSDoc tag similar to the below:
/**
 * @example Example Output
 * {
 *   name: "Testy McTest",
 *   email: "testy.mctest@not_an_email.com"
 *   gender: "ambiguous"
 * }
 */
const theProfile = getProfile();
  1. Observe the tooltip for theProfile. VSCode parses the @not_an_email as a JSDoc tag, breaking the code formatting. It will do this even if the example code is fenced in back-ticks, with slightly different output.

Does this issue occur when all extensions are disabled?: N/A

@mjbvz mjbvz self-assigned this Jun 3, 2020
@mjbvz mjbvz transferred this issue from microsoft/vscode Jun 3, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Jun 3, 2020

Potential fixes:

  • Require the @ always be prefixed by a whitespace, {, or the start of the line (this would not fix other cases such as email: "a @ b"

  • Only parse inline jsdoc tags if they are known, such as @link

@mjbvz mjbvz removed their assignment Jun 3, 2020
@MartinJohns
Copy link
Contributor

Duplicate of #35310.

@sandersn
Copy link
Member

sandersn commented Apr 8, 2021

Duplicate of #39371, and fixed in #42364.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants