No TypeScript doc hints for function parameters?

This is from the official TypeScript site's playground (below). Note how I can make comments for function parameters, and autocomplete will give me hints. WebStorm doesn't do this.

In fact, it shows a warning when I try to do this:

0

Can't see any warnings:

Looks as if you have some language injected in comment... do you have any custom injections defined in Settings | Editor | Language Injections? Check all injections with IDE or Project scope. Also, do you have any third-party plugins installed?

0

Attaching screenshots of my downloaded plugins and language injections. I also just disabled a bunch of built-in plugins that I'll never use, and it didn't help.

 

0

I had to disable "Syntax errors and unresolved references in JSDoc. Weird.

However, in .ts files, there is still no pop-up documentation for comments above function parameters as there should be:

0

Inline comments are only used to add type information (in javaScript only). The right way to document function params is using @param annotation:

 

/**
*
* @param track some ID
* @param value some value
*/
async function updateTrack(
track,
value
) {
}
0

Got it. The official TypeScript playground and VS Code do support this method, though I can't seem to find it officially documented anywhere, so maybe it's not officially supported yet.

function doSomething(
/** First name */
firstName: string,
/** Last name */
lastName: string,
/** Signup code returned by TOTP method */
code: number
) {
// Code
}

BTW, is there any way to see the param docs in the Parameter Info popup?

0

>is there any way to see the param docs in the Parameter Info popup?

 

no way, if you miss it, please feel free to file a feature request to youtrack, https://youtrack.jetbrains.com/issues/WEB

0

请先登录再写评论。