Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda