vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

Vetur intellisense breaks all the time #3161

Open fabis94 opened 3 years ago

fabis94 commented 3 years ago

Info

Problem

In a TypeScript + Vue project, it seems like Vetur caches a specific state of TypeScript types, and then when these TypeScript types are changed, Vetur doesn't know anything about it and reports misleading errors.

For example: I add a new value to an Enum and try to use it in Vue - Vetur reports the Enum value doesn't exist. Or I add a new method inside a module that is definitely exported out from that module - Vetur reports the method doesn't exist.

Only after triggering a restart of the Vue Language Server through the "Vetur: Restart VLS" command does Vetur finally parse all of the types again and realizes they have changed.

Is this a common issue? Is there a way to deal with this without having to trigger a restart of VLS every 5 minutes?

yoyo930021 commented 3 years ago

Where path is your file changed? Vetur will listen to project files, but not in node_modules and outside project.

fabis94 commented 3 years ago

It's clearly able to find the files once to be able to resolve them once, it just doesn't keep tracking any updates to types inside them

yoyo930021 commented 3 years ago

It's clearly able to find the files once to be able to resolve them once, it just doesn't keep tracking any updates to types inside them

If vetur listen file changed, the type also will update.

If you provide a repro case, we can study quickly. https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

susnux commented 3 years ago

Same here.

Also if you rename a variable, intellisense still shows the old name: Screenshot_20211115_090405 Screenshot_20211115_090417

Vetur 0.35
Project uses: Vue3 + Typescript 4.4.4

VS Code:
Version: 1.62.2
Commit: 3a6960b964327f0e3882ce18fcebd07ed191b316
Date: 2021-11-11T20:51:30.084Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.14.14-2-default