Skip to content

Support jsdoc @ linkcode and @ linkplain variations of @ linkΒ #43935

Closed
@mjbvz

Description

@mjbvz

Bug Report

πŸ”Ž Search Terms

  • jsdoc
  • link
  • see

πŸ•— Version & Regression Information

4.3.0-dev.20210503

⏯ Playground Link

Playground link with relevant code

Request

JSDoc has two variants of @link:

  • @linkcode for code links
  • @linkplain for plain text links

https://jsdoc.app/tags-inline-link.html

For example:

/**
 * {@linkcode foo}
 */
function foo(): { a: number; } {
    return {a: 1}
}

These variants currently don't seem to be parsed by TS. We'd like these to be treated as links too. I imagine the documentation result from TSServer could simply change from having {@link to {@linkcode on the opening link token, and leave all the formatting up the the editor:

 "documentation": [
        {
            "text": "",
            "kind": "text"
        },
        {
            "text": "{@linkcode ",
            "kind": "link"
        },
        {
            "text": "foo",
            "kind": "linkName",
            "target": {
                "file": "/Users/matb/projects/san/x.tsx",
                "start": {
                    "line": 15,
                    "offset": 4
                },
                "end": {
                    "line": 17,
                    "offset": 2
                }
            }
        },
        {
            "text": "}",
            "kind": "link"
        }
    ],

Metadata

Metadata

Assignees

Labels

Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureFix AvailableA PR has been opened for this issueSuggestionAn idea for TypeScriptVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions