-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Bug: Auto import from vue adds separate import statements in .vue files #4756
Comments
Can't reproduce. Please try to reproduce this with an empty vscode profile (no extensions). If you can still reproduce, let me know. Otherwise, enable one extension after the other in the empty profile to find out if this issue is caused by a thirdparty extension. Thanks |
I have same issues with auto import in Nuxt |
There seems to be a regression. Nuxt auto-imports are not working in 2.1x |
Who wants to open an issue with nuxt? :) |
I have disabled all extensions, except Volar (so that it can autocomplete in a .vue file) and the problem is still happening. Here is how to reproduce it (this is my setup):
The result is: <template>
<div>A</div>
</template>
<script setup>
import { computed } from 'vue'
import { ref } from 'vue'
const t1 = ref()
const t2 = computed
</script>
<style lang="scss" scoped></style> |
I just tested with a brand new Vue project ( |
Experiencing this as well, this only occurs in .vue files, not seeing any issue in .ts files. Screen.Recording.2024-08-31.at.19.41.21.movNote popup incorrectly shows |
We are no longer actively maintaining LSP-only mode, does enabling hybrid mode resolve the problem? |
Is there an existing issue? If not, can you open a new issue? |
I confirm that switching Hybrid Mode to |
Vue - Official extension or vue-tsc version
2.1.2
VSCode version
1.92.2
Vue version
3.4.38
TypeScript version
5.5.4
System Info
No response
Steps to reproduce
This happens only in .vue files, works ok in .js files.
Every time I use auto import from 'vue', the symbol I select is imported in a separate import statement (separate line), resulting in multiple
import { ... } from 'vue'
statements.Note: I already reported this issue to VSCode devs (microsoft/vscode#227042) but they said it's Vue related and should be reported here.
VSCode Extensions (19)
What is expected?
Expected result is to reuse the 1st import statement and add the symbol there.
What is actually happening?
Here is the state before I auto-import the second symbol from vue:
And here is what happens immediately after I hit Enter on the
computed
symbol:Link to minimal reproduction
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: