Closed
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
Issue: vuejs/language-tools#3942
Vue TS Plugin modifies project language service at this line to handle virtual code mapping, which works well for ConfiguredProject. But for InferredProject, tsserver seems to always discard the existing language service when switching columns from .vue files to .ts files, and the newly created language service instance will not pass the plugin's create hook, so the plugin cannot modify it again.
However, the plugin's modifications to the language service host are retained, causing the vue file to display unmapped virtual code diagnostic messages.
Steps to reproduce
- Clone https://github.com/johnsoncodehk/volar-starter
Since it is just for demonstration purposes, node_modules will not be installed. - Delete the
tsconfig.json
file in repo - Open the repo in VSCode, install https://marketplace.visualstudio.com/items?itemName=Vue.volar 2.0.4 and open
src/components/HelloWorld.vue
- You should see TS errors reported due to missing dependencies, as shown below:
- Close
HelloWorld.vue
, opensrc/main.ts
, then re-openHelloWorld.vue
- Errors in the image above is now displayed in the wrong location (end of file)