Skip to content

Omit spaces after https in jsdoc comments #43800

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

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

sandersn
Copy link
Member

Omit spaces after https in jsdoc comments for tags with names.

Fixes #42581

I experimented with a more comprehensive change that made the parser retain all spaces and moved the responsibility to insert (or omit) the space to the language service. But it would have required another parser change to distinguish initial newlines, plus some too-clever code in the language service to handle initial newlines.

I noticed that #42581 doesn't ask for for whitespace-perfect comment preservation in the compiler API, just no spaces after http in the @see tag, so I decided to make an ad-hoc fix.

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels super kludgy to me, but I guess if it ends up mattering, you can come back to the parser change.

@sandersn
Copy link
Member Author

I agree, but switching the processing of comment whitespace from the parser to the language service is a big change -- I forgot to mention the margin/offside handling would have to move too -- and it would break anybody using the compiler API to get the comment text, since they're expecting processed, not raw, comment text. An API break like that would need to until Typescript 5.0 for sure. 🚎

@sandersn sandersn merged commit d171eee into master Apr 23, 2021
@sandersn sandersn deleted the omit-spaces-after-https-in-jsdoc branch April 23, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbol#getJsDocTags adds whitespace in URLs
4 participants