Skip to content

Intellisense for vue is broken #46115

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

Closed
TheDutchCoder opened this issue Sep 28, 2021 · 9 comments
Closed

Intellisense for vue is broken #46115

TheDutchCoder opened this issue Sep 28, 2021 · 9 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@TheDutchCoder
Copy link

Bug Report

πŸ”Ž Search Terms

intellisense, vue, import

πŸ•— Version & Regression Information

  • This changed between versions [unknown] and version: 1.60.2

⏯ Playground Link

N/A

πŸ’» Code

// Current, broken behaviour
export default defineC // intellisense will suggest `defineComponent` from @vue/runtime-core

// Old, correct behaviour
export default defineC // intellisense will suggest `defineComponent` from vue

πŸ™ Actual behavior

TS resolves any Vue export from its submodule, instead of the main vue package

πŸ™‚ Expected behavior

TS to resolve from vue

@Shinigami92
Copy link

But only for Vue 3 please... ?!

In Vue 2 it should be

export default defineC // intellisense should suggest/prefer `defineComponent` from @vue/composition-api instead of `vue` or `vue-demi`

@sandersn
Copy link
Member

sandersn commented Oct 6, 2021

What version of Typescript is this? Is this vue 1.60.2? vs code 1.60.2?
Can you provide an example repo?

@sandersn sandersn added the Needs More Info The issue still hasn't been fully clarified label Oct 6, 2021
@Shinigami92
Copy link

@sandersn

What version of Typescript is this? Is this vue 1.60.2? vs code 1.60.2?

VS Code 1.60.2

Vue is in Version 2.x or 3.x, 1.x is completely outdated.

@andrewbranch
Copy link
Member

// Current, broken behaviour
export default defineC // intellisense will suggest `defineComponent` from @vue/runtime-core

Is this example right? Why would we suggest any auto-imports at export default? IMO we should only show locals there. The general issue of the auto-import coming from the wrong place is almost definitely a duplicate of #45784 and fixed by #45792.

@andrewbranch
Copy link
Member

Can anyone try this with typescript@next and see if the problem persists? (https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next)

@henribru
Copy link

Just tried it with v4.5.20211015 and VS Code is still importing defineComponent from @vue/runtime-core

@lukaskleinschmidt
Copy link

@andrewbranch It is working for me with typescript@next in a regular .js file.
In SFC it still doesnt work, but honestly I have no idea whether this is more of a Vetur or Volar problem?

@andrewbranch
Copy link
Member

Should be fixed by #46437

@xd-shadow
Copy link

so has the problem been fixed? it is still exists with me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

7 participants