Description
If a type is defined through typedef
(given a name), then description / suggestions only show the name.
But to be useful, it should show the details of the type.
I'll make a code comparison and show the different results:
The variant I'd like to improve
We define a type through typedef
/**
* @typedef {object} myOptions
* @property {number} option1
* @property {string} option2
*/
/**
* @param {myOptions} options
*/
function doSomethingElse (options) {
// ...
}
Hovering the function call will only give us the typedef name. We have no idea what the actual options are.
I thought I could maybe ctrl/cmd click on the type name in the description to go to the definition, but nothing happens.
Same while typing, we have no information.
Compare to inline jsdoc (best description result)
/**
* @param {{option1: number, option2: string}} options
*/
function doSomething (options) {
// ...
}
Hovering the function call, we have a nice description of the options argument.
Same while typing, we have details about the options.
Side note: strange that we don't have a nice syntax highlighting while typing, seems it would be easier to reuse the hovering logic and show the same thing.
Feature request
So, what I'd like is vscode to show the same thing for the @typedef
case than for the inline jsdoc case.