language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

No suggestions for Components Props

Open mhzsam opened this issue 1 year ago • 18 comments

hi one important problem is when i migrate from Volar & Vetur to this i did not seen any suggestions for Components props

mhzsam avatar Mar 09 '24 20:03 mhzsam

Same here. Downgraded to v1.8.27

anegelya avatar Mar 10 '24 10:03 anegelya

thank you very much. the problem solved - why new version does not have this feature??

mhzsam avatar Mar 10 '24 14:03 mhzsam

I have the same problem, how can I solve it?

lovesnsfi avatar Mar 11 '24 03:03 lovesnsfi

@mhzsam This is a bug. So I reopened this issue.

so1ve avatar Mar 11 '24 05:03 so1ve

I have the same problem, how can I solve it?

I downgrade to v1.8.27 and all things its OK

mhzsam avatar Mar 11 '24 16:03 mhzsam

I've downgraded to 1.8.27 but still no intelliense for *.vue files, even I wrote the wrong import path intentionally it didn't give any error: image

hansonfang avatar Mar 13 '24 08:03 hansonfang

didn't give any error

Remove vue-shim.d.ts

so1ve avatar Mar 13 '24 08:03 so1ve

Let's track at https://github.com/vuejs/language-tools/issues/4074 since it is more detailed.

so1ve avatar Mar 15 '24 01:03 so1ve

Ugh they are not the same :(

so1ve avatar Mar 15 '24 01:03 so1ve

Are there any logs that I could provide to be useful to debug this?

This issue has been affecting the DX of @nuxt/ui (issue #1501) since volar 2.0

sandros94 avatar Apr 01 '24 23:04 sandros94

With 2.0.10 locally defined components do seem to be correctly resolved, while dep ones still aren't.

sandros94 avatar Apr 06 '24 01:04 sandros94

I also noticed weird behavior, maybe it will help, for example, I use Nuxt UI, and in .nuxt/components.d.ts it resolves only client components:

// doesn't work
'UModal': typeof import("../node_modules/@nuxt/ui/dist/runtime/components/overlays/Modal.vue")['default']

// works fine
'UModals': typeof import("../node_modules/@nuxt/ui/dist/runtime/components/overlays/Modals.client.vue")['default']

Extension version - 2.0.10 Nuxt UI version - 2.15.2

manchenkoff avatar Apr 15 '24 23:04 manchenkoff

I also noticed weird behavior, maybe it will help, for example, I use Nuxt UI, and in .nuxt/components.d.ts it resolves only client components:

// doesn't work
'UModal': typeof import("../node_modules/@nuxt/ui/dist/runtime/components/overlays/Modal.vue")['default']

// works fine
'UModals': typeof import("../node_modules/@nuxt/ui/dist/runtime/components/overlays/Modals.client.vue")['default']

Extension version - 2.0.10 Nuxt UI version - 2.15.2

Form what I could figure out the reason Modals.client.vue works is because in the built source code it doesn't have an accompanying .vue.d.ts file.

I came to this conclusion because any component that when built is split into .vue and .vue.d.ts files seems to have their types broken while the ones that are split as .mjs and .d.ts files are still working.

Then I tried writing a component myself in application code both with MyComp.vue and MyComp.vue.d.ts, when I do that MyComp.vue file seems to take precedence, only when the MyComp.vue file is deleted does the type system fallback to the MyComp.vue.d.ts file and display the types correctly.

This still doesn't explain why the types would be any though when the component lives inside a package instead of application code or does this makes sense for some reason I'm not aware of.

Even though this doesn't definitively explain the stuation with UModals it does seem related. So I wanted to offer my two cents.

Edit: Nevermind the issue seems to be fixed in the 2.0.14 relase for those that did not found the version, due to a bug in VS Marketplace there are currently two Vue - Official extensions listed. by the time you are reading this it might be fixed.

UfukUstali avatar Apr 27 '24 15:04 UfukUstali

Yep, with 2.0.14 it seems fixed

manchenkoff avatar Apr 27 '24 19:04 manchenkoff

I only now had time to upgrade from 2.0.10 to 2.0.17 and can also confirm it seems to be fixed.

Tested with Nuxt:

  • local components
  • remote components (layers via path, git and npm)
  • npm components

sandros94 avatar May 13 '24 10:05 sandros94

Not fully fixed. Directly typing ctrl-space will give suggestions, but if I type some characters, the extension fail to give any suggestion.

image

image

kingyue737 avatar May 14 '24 03:05 kingyue737

@kingyue737 I might be wrong, but it seems to me an extension conflict. Could you quickly test disabling all the extension but Vue - Official?

(I also imagine your ctrl+j being a custom binding)

sandros94 avatar May 14 '24 09:05 sandros94

My bad, not ctrl+j, it is ctrl+space which is the default keybinding for triggering suggestions on Windows. It does work currently but a little strange. I need to wait 1 ~ 2 seconds (which seems much slower than v1.8.27) before the extension gives suggestions automatically. If I press ctrl+space to manually trigger suggestions during this "1~2 seconds", it will show "no suggestions":

  1. Wait for suggestions (Work): bug1

  2. Trigger suggestions manually (Not work): bug2

I will investigate whether it is related to extension conflict or the mode of Vue - Official

kingyue737 avatar May 14 '24 10:05 kingyue737

Hey there, as there have been many fixes in the last 2.x versions: Please let us know if you're still encountering this issue. Otherwise kindly close this one, thanks!

davidmatter avatar Aug 07 '24 07:08 davidmatter