Skip to content

The @see JSDoc tag cannot create links from URLs #2306

@csvn

Description

@csvn

Steps to reproduce

  1. Open VSCode with the TypeScript Native Preview extension.
  2. Paste in this code example
    /**
     * @see https://example.com
     */
    const test = 0;
  3. Hover over the test variable
  4. The link does not work and is rendered incorrectly

Perhaps it's some new parsing of @see tags for JSDoc with the Language server, but it's very different from TypeScript 5.9. This seems to be related to how @see <namepath> is parsed.

const foo = () => { /* .. */ };

/**
 * @see foo
 * @see foo description
 * @see {@link foo}
 * @see {@link foo} description
 */
const bar = () => { /* .. */ };
typescript@5.9 tsgo
Image Image

Behavior with typescript@5.9

Markdown generated is _@see_ &mdash [https://example.com](https://example.com)

Image

Behavior with tsgo

Markdown generated is similar to _@see_ `https` &mdash; ://example.com

Image

Extra notes

It's not a regression compared to TS 5.9, but it's a bit weird that with this code example:

const foo = () => { /* .. */ };

/**
 * @see foo
 * @see foo description
 */
const bar = () => { /* .. */ };

The following is true:

  • The foo name can use "Go to definition" for @see foo [...]
  • The markdown generated for both TSGO and TS 5.9 is not a clickable link
  • Must be converted to {@link foo} for foo to be navigable for both Markdown and "Go to definition"

Given the description on https://jsdoc.app/tags-see (below), I would expect @see <namepath> to work the same as @see {@link <namepath>}.

You can provide either a symbol's namepath or free-form text. If you provide a namepath, JSDoc's default template automatically converts the namepath to a link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions