neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

Some JSDoc params don't contribute to autocomplete #356

Open jcuffe opened 2 years ago

jcuffe commented 2 years ago

Minimal reproduction:

const yup = require("yup")

const schema = yup.object().shape({ a: yup.string(), b: yup.number(), c: yup.array() })

/** @typedef {yup.Asserts<typeof schema>} Schema */

/**
 * @param {Schema} bar
 */
function foo(bar) {
  bar.
}

VSCode: image

Coc-Tsserver: image


JSConfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "checkJs": false,
    "jsx": "react-jsxdev",
    "module": "esnext",
    "target": "esnext",
    "paths": {
      "@EMPLOYER/util/*": ["shared/util/*"]
    },
    "moduleResolution": "node",
    "strictNullChecks": true
  },
  "exclude": ["node_modules", "**/node_modules", "./web-app/dist"]
}
jcuffe commented 2 years ago

I'm honestly not sure how VSCode does this, so any direction here would be great 😅

chemzqm commented 2 years ago

Could be caused by different tsserver version, checkout https://github.com/neoclide/coc-tsserver/blob/master/Readme.md#troubleshooting