-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
In vue components, if a symbol is imported from 'vue' module, additional imports are not auto-completed. #2190
Comments
FWIW: Works fine for me. |
me too, v1.0.13 |
This comment was marked as outdated.
This comment was marked as outdated.
My fault, I found that when changing the cancel token to always respond true, I can always get |
@johnsoncodehk Sounds great, thank you for looking into it! |
@johnsoncodehk Unfortunately, the issue is still there even after upgrading to v1.0.18. import { ref } from 'vue';
watch... // <--- Autocomplete gives you [TS Error] {} but at the same time autocomplete works perfectly if you comment out the |
this bug still exists after update to |
This is a bug from TypeScript, but it can't reproduce in .ts because Here is a workaround for now.
{
"javascript.preferences.autoImportFileExcludePatterns": [
"@vue/runtime-core",
"@vue/runtime-dom"
],
"typescript.preferences.autoImportFileExcludePatterns": [
"@vue/runtime-core",
"@vue/runtime-dom"
]
}
|
@johnsoncodehk I've tried it that way and it sometimes do really work but sometimes still fails. However, as I understand this workaround only works for |
@mattersj If you do not rely on TS 4.9 features, you can temporarily downgrade to 4.8.3. |
@johnsoncodehk I haven't realized right away that this bug is related to the latest TS minor release, thanks for clearing this up. |
Thanks for everyone's efforts. Is there an issue open in the Typescript project for the underlying issue? I'm not really up on the details, but it may be prudent for someone who better understands it to make one if not. |
@michaeldaw There was a similar issue in the past: microsoft/TypeScript#46115 It's a bit difficult to provide the minimal reproduction needed for this issue, because as I said tsserver in *.ts just happens to bypass the issue. I have to done my other priorities first and then I will see if I can submit a PR for this. |
@mattersj since |
@johnsoncodehk Yep, it handles this case but the issue is not only with |
volar v1.0.24 i'm getting a similar problem: volar keeps throwing this:
and it is intermittent. reloading the vscode window sometimes gets it working but then after a few minutes it does again. i tried with and without |
Hold off ~4.9 until vuejs/language-tools#2190 is resolved
Fixed by microsoft/TypeScript#52686 |
Yeah looks like the fix is just not in any typescript release yet:
|
@BARNZ now we can install |
this is for the project/workspace typescript or for the operating system global typescript? |
Hold off ~4.9 until vuejs/language-tools#2190 is resolved
I have the latest TS version, it's still not working for me. Please help. |
there was something i did recently that made it work again 😅 but i forgot what it was (took me a million tries 🫠). if there is a way for me to share my current config i could paste it here. |
Post a JSFiddle or CodePen link. 👍 I think it's funny that as soon as I come to this thread I see 2 recent posts about something I'm experiencing this morning, but did not yesterday. Really odd. Stars aligned I guess. |
@ryanaltvater |
* fix: upgrade the typescript to v5 to resolve the vuejs lang server issue vuejs/language-tools#2190 * fix: make admin user page an independent page component, downgrade ts for supporting estree
Hold off ~4.9 until vuejs/language-tools#2190 is resolved
example:
Start with an empty vue component.
Begin typing 'onMounted' and hit tab to auto-complete.
An import statement is created in which onMounted is imported from 'vue'.
Begin typing 'onUnmounted' and hit tab to auto-complete.
'onUnmounted' is not added to the imports from 'vue'.
Other modules seem to work fine. This only seems to happen with the 'vue' module.
test.mp4
The text was updated successfully, but these errors were encountered: