Skip to content

@link: format trailing () as part of linkName #46428

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 1 commit into from
Oct 20, 2021

Conversation

sandersn
Copy link
Member

Parsing separates the identifier part of the link tag from its text, but the editor should present an identifier followed by () as a single identifier since people use that syntax as a function sigil.

I prefer #' personally, you know, xkcd 297, nudge nudge.

Fixes #44495

Parsing separates the identifier part of the link tag from its text, but
the editor should present an identifier followed by `()` as a single
identifier since people use that syntax as a function sigil.

I prefer `#'` personally, you know, xkcd 297, nudge nudge.
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 19, 2021
Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

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

I have some general questions to understand the context of this change: is that behavior specified in the JSDoc spec? Or do we just want to support this because some people use it? If that's the case, I'm also guessing it's ok to deviate from the spec like so because we're only changing how we display the JSDoc in quick info.

@sandersn
Copy link
Member Author

Good question. JSDoc namepaths don't specify postfix-(). We just want to support this since some people use it. In general, Typescript understands a lot more variants of JSDoc than jsdoc does.

Typescript supports most of jsdoc except namepaths -- we only resolve identifiers using typescript rules. The biggest difference is that we use import("foo").Type instead of module~foo.Type (or something like that).

@sandersn sandersn merged commit 98b4ac2 into main Oct 20, 2021
@sandersn sandersn deleted the link-tag-parse-trailing-parens-as-linkName branch October 20, 2021 15:36
sandersn added a commit that referenced this pull request Oct 20, 2021
sandersn added a commit that referenced this pull request Oct 21, 2021
mprobst pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
Parsing separates the identifier part of the link tag from its text, but
the editor should present an identifier followed by `()` as a single
identifier since people use that syntax as a function sigil.

I prefer `#'` personally, you know, xkcd 297, nudge nudge.
mprobst pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
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.

@link jsdoc tags parse trailing parens as linkText
3 participants