Skip to content
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

Stray @ signs parsed in JSDoc #43580

Closed
evmar opened this issue Apr 7, 2021 · 3 comments Β· Fixed by #43602
Closed

Stray @ signs parsed in JSDoc #43580

evmar opened this issue Apr 7, 2021 · 3 comments Β· Fixed by #43602
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@evmar
Copy link
Contributor

evmar commented Apr 7, 2021

Bug Report

πŸ”Ž Search Terms

jsdoc at sign

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about JSDoc

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

/** @return The @ sign from the email */
function getAtSign() {}

πŸ™ Actual behavior

JSDoc parsed (in Monaco hover etc) as if the bare '@' sign itself is a separate JSDoc tag.

πŸ™‚ Expected behavior

JSDoc parsed where the "The @ sign from the email" is all the documentation of the return type.

@evmar
Copy link
Contributor Author

evmar commented Apr 7, 2021

Related to #38922 a bit, but in this case there is whitespace on either side of the "@" sign so it should make the parsing easier.

@DanielRosenwasser DanielRosenwasser added the Needs Investigation This issue needs a team member to investigate its status. label Apr 7, 2021
@DanielRosenwasser
Copy link
Member

Seems like an @ should be a tag strictly when followed by [a-zA-Z], maybe with some other rules about the left side (which are probably a lot harder to nail down).

@sandersn
Copy link
Member

sandersn commented Apr 8, 2021

We nailed down the rules for the left side in #39371 (comment) and implemented that fix in #42364.

I think a fix to the right side should be similarly conservative, and only start a tag before non-whitespace. (Barring data that shows that this is a big problem in practice, in which case we should do a similar analysis to the one I did for #39371.)

Edit: Because this isn't part of the jsdoc documentation, a lone @ will probably still break other jsdoc tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants