typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

The `@see` JSDoc tag cannot create links from URLs

Open csvn opened this issue 2 weeks ago • 6 comments

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 = () => { /* .. */ };
[email protected] tsgo
Image Image

Behavior with [email protected]

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.

csvn avatar Dec 09 '25 19:12 csvn

@team can you please assign this issue to me? i love to contribute to this ?

maishivamhoo123 avatar Dec 10 '25 04:12 maishivamhoo123

@maishivamhoo123 Unless the work to solve this requires a large rewrite, you can most likely just start creating a PR and link to this issue and mention you're working on a fix.

I don't think it's common for non-maintainers of the project being assigned issues. 🙂

csvn avatar Dec 10 '25 14:12 csvn

You can't assign a non-member, no, and even if so: https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md#issue-claiming

jakebailey avatar Dec 10 '25 15:12 jakebailey

Ah, sorry. I hadn't read that part 😅

csvn avatar Dec 10 '25 15:12 csvn

Sorry, I missed that point in the CONTRIBUTING.md. Thank you for the clarification , I’ve read the issue-claiming section now, and I’ll proceed accordingly and open a PR if I’m able to fix it. Thank you sir!

maishivamhoo123 avatar Dec 10 '25 16:12 maishivamhoo123

This is in code that I wrote, and I've got a fix ready.

ahejlsberg avatar Dec 11 '25 18:12 ahejlsberg