Skip to content

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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

5 participants