VSCode's Intellisense ignores my JSDoc comment and instead is inferring what the definition should be.
Function with JSDoc comment:
/**
* @param { Array<number> } arrayOfNumbers
* @return { number } sum - the sum of the arrayOfNumbers
*/
const getSumOfArrayElements = reduce (add, 0)
VSCode output:
const getSumOfArrayElements: (list: readonly any[]) => number
@param arrayOfNumbers
@return — sum - the sum of the arrayOfNumbers
Intellisense is defining getSumOfArrayElements as the definition for the return value of reduce (add, 0) (reduce with 2 arguments supplied)
Is there a way to have JSDoc comments have top priority in VSCode?
Thanks!
EDIT:
Just noting that this does work as expected
/**
* @param { Array<number> } arrayOfNumbers
* @return { number } sum - the sum of the arrayOfNumbers
*/
const getSumOfArrayElements = arrayOfNumbers => reduce (add, 0) (arrayOfNumbers)
Also, adding @function to the JSDoc comment doesn't change anything.