The `@see` JSDoc tag cannot create links from URLs
Steps to reproduce
- Open VSCode with the TypeScript Native Preview extension.
- Paste in this code example
/** * @see https://example.com */ const test = 0; - Hover over the
testvariable - 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 |
|---|---|
Behavior with [email protected]
Markdown generated is _@see_ &mdash [https://example.com](https://example.com)
Behavior with tsgo
Markdown generated is similar to _@see_ `https` — ://example.com
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
fooname 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}forfooto 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.
@team can you please assign this issue to me? i love to contribute to this ?
@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. 🙂
You can't assign a non-member, no, and even if so: https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md#issue-claiming
Ah, sorry. I hadn't read that part 😅
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!
This is in code that I wrote, and I've got a fix ready.