microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.75k stars 12.46k forks source link

Formatting Intellisense For Better JS/TS Doc Integration #60300

Open DaveyJake opened 3 days ago

DaveyJake commented 3 days ago

Does anyone know if it is possible to modify VSCode Intellisense for JSDoc and TSDoc tags? I have always been bothered by the way VSCode handles certain JS/TS doc tags and I just cannot handle it anymore.

As trivial as it might sound, when documenting custom interface and type definitions, I just want the @property tag to be formatted in the same manner as the @param tag. The following screen shots illustrate my issue:

Image

Notice the emdash between the @property tags and the keys being described above?

Image

See how it's placed after the @param tags and the respective keys?

If this feature cannot be implemented, does anyone know of any extensions that already do this or which files need to be modified to make this change?

Any advice would be much appreciated. Cheers 🍻

mjbvz commented 8 hours ago

Moving to TS since we'd need the jsdoc tag structure to be returned in a consistent way. Here's it for:

/**
 * @param x abc
 * @property y xyz
 */
const a = '';
 "tags": [
        {
            "name": "param",
            "text": [
                {
                    "text": "x",
                    "kind": "parameterName"
                },
                {
                    "text": " ",
                    "kind": "space"
                },
                {
                    "text": "abc",
                    "kind": "text"
                }
            ]
        },
        {
            "name": "property",
            "text": [
                {
                    "text": "y xyz",
                    "kind": "text"
                }
            ]
        }
    ]