Skip to content

Parse generics in JSDoc @link symbol names #44818

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#127557

Bug Report

🔎 Search Terms

  • JSdoc
  • @link
  • quickInfo

🕗 Version & Regression Information

4.3.4

Not a regression

💻 Code

class Foo<T> {
    /**
     * a {@link Foo}
     * 
     * b {@link Foo<T>}
     */
    bar(){}
}
  1. Hover over bar

🙁 Actual behavior

The {@link Foo<T>} link is not resolved correctly

🙂 Expected behavior

The link should be resolved the same way as the normal {@link Foo} link

Here's the compete response:

Trace  - 21:46:34.955] <semantic> Response received: quickinfo (188). Request took 1 ms. Success: true 
Result: {
    "kind": "method",
    "kindModifiers": "",
    "start": {
        "line": 7,
        "offset": 5
    },
    "end": {
        "line": 7,
        "offset": 8
    },
    "displayString": "(method) Foo<T>.bar(): void",
    "documentation": [
        {
            "text": "a ",
            "kind": "text"
        },
        {
            "text": "{@link ",
            "kind": "link"
        },
        {
            "text": "Foo",
            "kind": "linkName",
            "target": {
                "file": "/Users/matb/projects/san/x.ts",
                "start": {
                    "line": 1,
                    "offset": 1
                },
                "end": {
                    "line": 8,
                    "offset": 2
                }
            }
        },
        {
            "text": "}",
            "kind": "link"
        },
        {
            "text": "\n\nb ",
            "kind": "text"
        },
        {
            "text": "{@link ",
            "kind": "link"
        },
        {
            "text": "Foo",
            "kind": "linkName",
            "target": {
                "file": "/Users/matb/projects/san/x.ts",
                "start": {
                    "line": 1,
                    "offset": 1
                },
                "end": {
                    "line": 8,
                    "offset": 2
                }
            }
        },
        {
            "text": "<T>",
            "kind": "linkText"
        },
        {
            "text": "}",
            "kind": "link"
        }
    ],
    "tags": []
}

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions