Closed
Description
Bug Report
π Search Terms
parameters jsdoc description message
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
parameters
β― Playground Link
Playground link with relevant code
π» Code
/**
* A function that returns the number you pass to it.
*/
function myCoolFunction(x : number) {}
function basicallyTheSameFunction(...args : Parameters<typeof myCoolFunction>) {}
Then hover over basicallyTheSameFunction
.
π Actual behavior
The function does not have a description, whereas myCoolFunction
does.
π Expected behavior
The basicallyTheSameFunction
would have the same description as myCoolFunction
.
π Motivating Example
I'm not familiar with the inner workings of TypeScript, so in case this is more of a feature request rather than a bug report, please consider the following use case: playground link
When working with jsdoc only, I think the cleanest way of supporting overloaded functions for Intellisense is like this:
/**
* This function takes a number and a string.
* @param {number} num
* @param {string} str
*/
function signatureA(num, str) {}
/**
* This function takes a boolean and an object
* @param {boolean} bool
* @param {Object} obj
*/
function signatureB(bool, obj) {}
/**
* @param {Parameters<typeof signatureA> | Parameters<typeof signatureB>} args
*/
function overloaded(...args) {}
Then when typing overloaded()
, the parameter suggestions window will show all the possible signatures, but unfortunately descriptions are not copied this way.