-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense does not work for auto-imported components #477
Comments
Thank you @Sight-wcg for the pointers! I'll summarize the answers in English here for others who might be facing the same issue: The problem occurs in the automatically generated There are several ways to solve this issue:
If you chose option 1 or 2 and created the Maybe solution 1 should be added to the plugin docs? PS: Credits to wangyu-personal and loosheng for their answers in the related threads. |
I am having the same issue - and I am using |
@ThaDaVos I just tested using |
@mareszhar |
That one works for me - strangely, it has
That's not true in my case, it's: |
@mareszhar should the Intellisense of that repo look like this? If I click it, it opens |
In this docs you could see add components.d.ts to your tsconfig.json under include |
@ThaDaVos Correct, that's the same intellisense preview I see of the |
@donghero You only need to add |
is there currently no way to enable this click to go to the actual component? |
I had trouble with this too. I tried options 1, 3, 4, and 5 from this comment, no luck. I specifically had trouble with getting type-checking on inline functions within a <MyComponent @some-event="
(someParam) => someFunction(someParam)
"></MyComponent> would give me I can verify that the auto-import is the problem because if I simply import the component Please let me know if there is a fix for this issue or if I have something messed up on my end. |
Any updates on this? With neovim, while in the SFC, gd to goto definition, then gf on the file name works, while not the best, it gets you where you want to go. Anyone with success on neovim and having gd get you to the component without the middle through the .d.ts? |
The core answer |
I also have this issue in WebStorm but it may be due to Volar support there being experimental, adding explicit imports is working just fine. |
Does anyone know an solution for yarn? npmrc doesn't work with yarn, I coul only get it working with npm and pnpm |
Describe the bug
When I hover over an auto-imported component, intellisense does not work. There is no information about the imported component in the modal that opens up:
After a lot of experimentation, I noticed that this only occurs when the module name in the auto-generated
components.d.ts
file is@vue/runtime-core
.If I change the module name from
@vue/runtime-core
tovue
, intellisense works!The problem is that manually changing the module name is not sustainable. Whenever
unplugin-vue-components
detects a new component in my components' directory, it updates thecomponents.d.ts
file and changes the declared module name back to@vue/runtime-core
.Why does changing the module name restore intellisense support?
Is there any way to configure
unplugin-vue-components
to name the declared modulevue
instead of@vue/runtime-core
?I'm really confused by this bug. All help is appreciated.
Thank you for reading! ❤️
PS: I have version 0.39.2 of Vue Language Features (Volar) installed.
Reproduction
https://github.com/mareszhar/demo-imifcaiwuvc-mrfi
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: