Skip to content

Handle JSDoc {@link ... } inline tags #16498

Closed

Description

@mjbvz

From: microsoft/vscode#28624

TypeScript Version: 2.3.5

Code

/**
 * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler}
 */
function foo() {
    
}

Hover over foo

Bug
The following docs are returned:

Result: {
    "kind": "function",
    "kindModifiers": "",
    "start": {
        "line": 4,
        "offset": 10
    },
    "end": {
        "line": 4,
        "offset": 13
    },
    "displayString": "function foo(): void",
    "documentation": "",
    "tags": [
        {
            "name": "see",
            "text": "{"
        },
        {
            "name": "link",
            "text": "https://api.jquery.com/bind/#bind-eventType-eventData-handler}"
        }
    ]
}

Activity

  1. changed the title [-]Handle JSDoc `{@link ... }` inline blocks[/-] [+]Handle JSDoc `{@link ... }` inline tags[/+] on Jun 13, 2017
  2. kevinSuttle commented on Feb 20, 2018

    @kevinSuttle

    Just an FYI to VSCode users: you can use Markdown, which will render properly in the quick info popover UI. You won't get the syntax highlighting, though.

    /**
     * [Link](https://example.com)
     */
    

    You can also just use a plain URL now

    /**
     * https://example.com
     */
    
  3. added this to the milestone on Apr 12, 2018
  4. thw0rted commented on Apr 26, 2018

    @thw0rted

    Does this also address {@link OtherClass.method} ? (Is that the right way to link to a member of another class that JSDoc knows about?)

  5. Duckers commented on May 17, 2018

    @Duckers

    It would be awesome if links to language entities also worked with refactoring, so you can safely refactor entity names without invalidating documentation that talks about those members.

  6. Rhysjc commented on Jun 7, 2018

    @Rhysjc

    This doesn't seem to be fixed in the latest release. Any update?

  7. sandersn commented on Jun 7, 2018

    @sandersn
    Member

    Rhys Camm (@Rhysjc) we're still accepting PRs for this one.

    This is primarily a parsing problem, and not an easy one, since {@link ... } doesn't look like any other JSDoc tags we support. It would be good if you're familiar with our parser, or are familiar with parsing in general and want to learn the quirks of ours.

    Any solution will also have to decide whether @link is a child of whatever tag it appears in. The easy answer is 'no' since only a few tags can have children. But that would mean you would need to check that VS code displays a sequence of tags that includes @link in a pleasing way.

  8. DanielRosenwasser commented on Jun 21, 2018

    @DanielRosenwasser
    Member
  9. 24 remaining items

  10. orta commented on Sep 1, 2020

    @orta
    Contributor

    Cool, I've updated the number on staging - it'll either get deployed some time this week or on the normal Monday deploy cycle.

  11. Gaibhne commented on Apr 1, 2021

    @Gaibhne

    This issue should not be closed, this still happens in the latest version.

  12. panlina commented on Apr 5, 2021

    @panlina

    Any update on this issue? This issue should not be closed.

  13. amcasey commented on Apr 6, 2021

    @amcasey
    Member

    Gaibhne panlina Are you running typescript@next (aka nightly)? As far as I know, this is not yet available in the the version shipped with VS Code.

  14. Gaibhne commented on Apr 6, 2021

    @Gaibhne

    I'm using the regular stable release. As this issue was tagged as merged in May 2020, it would be merged for almost a whole year. Surely, it wouldn't still be stuck in nightly after all this time ?

  15. amcasey commented on Apr 6, 2021

    @amcasey
    Member

    Gaibhne I can't speak to the tagging, but the PR was only merged two weeks ago: #43312

  16. MartinJohns commented on Apr 6, 2021

    @MartinJohns
    Contributor

    This issue only related to {@link ...} tags containing http/https urls, and it works already. The other issue #35524 handles links to symbols and only got merged three weeks ago.

    Just read the comments on this thread:

  17. misha-erm commented on Feb 16, 2022

    @misha-erm

    This issue only related to {@link ...} tags containing http/https urls, and it works already. The other issue #35524 handles links to symbols and only got merged three weeks ago.

    Just read the comments on this thread:

    Martin Johns (@MartinJohns) looks like it doesn't work for me still. Links in hover popups aren't clickable and doesn't look like URLs

    /**
     * React hook to support both controlled/uncontrolled modes
     * @see {@link https://reactjs.org/docs/uncontrolled-components.html}
     */
    

    image

    It only start to work when I put link into brackets or some other characters like this @see {@link (https://reactjs.org/docs/uncontrolled-components.html)}

  18. sandersn commented on Feb 16, 2022

    @sandersn
    Member

    @MikeYermolayev please open a new issue for this. I believe the space after https is fixed in recent typescript builds, though, so check that out first.

  19. Gaibhne commented on Mar 11, 2022

    @Gaibhne

    Both the original issue, the issue of it only working with brackets and the issue with the erroneous space are all fixed in the current version, so I am unsubscribing to this issue - thank you for fixing this!

  20. bradennapier commented on Jan 22, 2023

    @bradennapier

    Matt Bierner (@mjbvz)

    There is currently a disconnect, i believe due to evolution of the @link definitions in the language service that creates a disconnect currently from tsdoc specification / typedoc

    I am not completely sure which side the disconnect is on, (typescript language service/vscode/typedoc/tsdoc) but the Link (@link) provides a LOT of opportunity to help users learn how to use a package as they actually code rather than referencing external website all the time.

    I am leaning towards this being a typedoc/tsdoc bug (which is why the item below was opened there), but figured it may be worth looking into on the vscode side to utilize the language services features around the Declaration References

    Screenshots of the disconnect in the issue linked below

  21. sandersn commented on Jan 23, 2023

    @sandersn
    Member

    Braden Napier (@bradennapier) for the vscode side of the example you give in the bug you link, name resolution is happening using normal typescript rules. I don't expect to change that. The typedoc resolution looks like a bug to me -- whether it's a spec bug or an implementation bug I'm not sure.

  22. bradennapier commented on Jan 25, 2023

    @bradennapier

    Nathan Shively-Sanders (@sandersn) yes that is as I thought, just wanted to make sure to mention here in case something seemed odd! Definitely better to resolve via actual imported values than always trying to match symbols globally -- can imagine that would get out of hand quickly.

    Thanks for the reply, I appreciate your time.

  23. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions