Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
How to override VSCode Intellisense inference with JSDoc comment

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.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda