vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 400 forks source link

In slightly more complex TypeScript scenarios, plugin component hints do not work. #4657

Closed MyDataHouse closed 3 months ago

MyDataHouse commented 3 months ago

Vue - Official extension or vue-tsc version

2.0.28

VSCode version

1.92.0

Vue version

3.4.35

TypeScript version

5.5.4

System Info

System:
    OS: Windows 10 10.0.22631
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11260H @ 2.60GHz
    Memory: 3.45 GB / 15.84 GB
  Binaries:
    Node: 20.11.1 - ~\AppData\Local\fnm_multishells\9528_1722996423355\node.EXE
    Yarn: 1.22.22 - D:\software\nodejs\node_global\yarn.CMD
    npm: 8.19.4 - ~\AppData\Local\fnm_multishells\9528_1722996423355\npm.CMD
    pnpm: 9.5.0 - D:\software\nodejs\node_global\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Steps to reproduce

You can download and run pnpm dev, and it will automatically generate component configuration types. However, you will notice that it doesn't provide type hints. When I delete components.d.ts, it starts to show the built-in Vue component types. image image

What is expected?

There are no proper component type hints.

What is actually happening?

I created an additional simple project configuration with only one tsconfig file, and the component type hints work correctly. However, in my case, where multiple tsconfig files are needed, the component type hints do not work. I have added the component type declaration files to tsconfig.web.json, but it still shows as any. I'm very confused.

Link to minimal reproduction

https://github.com/MyDataHouse/dom

Any additional comments?

No response

davidmatter commented 3 months ago

Hi @MyDataHouse do you think you could find some time to reproduce your issue in a minimal project? I'm working on some quite complex projects and can't reproduce your findings.

MyDataHouse commented 3 months ago

@davidmatter I have simplified the code https://github.com/MyDataHouse/example

davidmatter commented 3 months ago

Executing pnpm update in your repo makes everything work flawlessly

MyDataHouse commented 3 months ago

Thank you very much. In my official project, I needed to uninstall the @vitejs/plugin-vue-jsx dependency and then run pnpm update again. Everything finally worked normally.