vuejs / vetur

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

Vetur does not recognize extended types in js #1908

Open hidde-jan opened 4 years ago

hidde-jan commented 4 years ago

Info

Problem

Related to #1738, but it works for TypeScript, not for JS. Could be an issue with VSCode, but not certain.

When using Vetur and a plugin for Vue that extends the Vue constructor, Vetur does not recognize the new options when using JS, but does recognize them when using TypeScript. Of course, default options (name, props, etc.) are correctly typed in both JS and TS.

I've used the vue-socket.io-extended library as an example, same as in #1738:

JS:

Screenshot 2020-05-18 at 08 29 42

TS:

Screenshot 2020-05-18 at 08 29 51

Reproducible Case

Open each of the following repos with vscode, and check the HelloWorld component:

hidde-jan commented 4 years ago

I also just noticed it doesn't autocomplete props:

Screenshot 2020-05-18 at 10 09 13

If I reset the repository to the clean state (init commit done by vue create) it does work:

Screenshot 2020-05-18 at 10 10 40
jdz321 commented 4 years ago

I have the same issue.

yoyo930021 commented 4 years ago

I think #1775.