Skip to content
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

VSCode IntelliSense suggestions pop up as I type 'reactive', but 'reactive' not in the list. #9235

Closed
zhouyou-az opened this issue May 11, 2021 · 18 comments

Comments

@zhouyou-az
Copy link

Describe the bug
I want to quickly import reactive or other function from vue.
Although d.ts files in .node_modules/@VUE floder can't trigger code completion , d.ts files in .node_modules/quasar/dist/types floder can trigger code completion.

OS:win10
Node:14.16.1
NPM:6.14.12
Yarn: 1.22.10
Browsers:Chrome

@hawkeye64
Copy link
Member

@zhouyou-az Wouldn't this be more appropriate in the discussions on the Vue repo?

@zhouyou-az
Copy link
Author

@zhouyou-az Wouldn't this be more appropriate in the discussions on the Vue repo?

IntelliSense works as soon as I have copied .d.ts files from node_modules/@VUE floder to src floder.
Why does intelliSense not work when .d.t files are in node_modules?
IntelliSense works fine on another project which I I didn't move files and create by vue Cli.

@hawkeye64
Copy link
Member

@zhouyou-az It depends on your editor and any plugins you might be using that look for typings...
In many cases, they look for package.json and the "typings" key to find the .d.ts main file.
For example:
image
But, this has nothing to do with Quasar...

@soulsam480
Copy link
Contributor

soulsam480 commented Oct 12, 2021

@zhouyou-az It depends on your editor and any plugins you might be using that look for typings... In many cases, they look for package.json and the "typings" key to find the .d.ts main file. For example: image But, this has nothing to do with Quasar...

I'm facing this issue from a long time, the import intellisense works perfectly fine with a normal vue 2/3 project (generated from vue cli or vite CLI or custom) when I type some API function but it doesn't work in quasar projects. I have to explicitly import it. I'm not sure if you understood the question @hawkeye64 CC @yusufkandemir . Thanks

@IlCallo
Copy link
Member

IlCallo commented Oct 12, 2021

We're actually aware of the problem, TS recently started ignoring symbols from transitional dependencies, on which Quasar heavily relies on, and didn't provide any escape hatch
We're searching for a way to restore this core feature, but still haven't found it

@soulsam480
Copy link
Contributor

We're actually aware of the problem, TS recently started ignoring symbols from transitional dependencies, on which Quasar heavily relies on, and didn't provide any escape hatch We're searching for a way to restore this core feature, but still haven't found it

Thanks for this update.

@soulsam480
Copy link
Contributor

We're actually aware of the problem, TS recently started ignoring symbols from transitional dependencies, on which Quasar heavily relies on, and didn't provide any escape hatch We're searching for a way to restore this core feature, but still haven't found it

Hii @IlCallo , the intellisense somehow worked today, but the catch is it only works when there is an import from vue already. But again this is not perfect.

Here I have an existing import for computed from vue and when I type ref it gives me intellisense.
image

@IlCallo
Copy link
Member

IlCallo commented Oct 14, 2021

Well, yesterday VSCode stopped doing auto-imports from lodash package in my projects, so I guess the problem is only partially related to Quasar 😄
If you want to dig further and check out how we could make TS recognize transitional deps, that would help us out!

@soulsam480
Copy link
Contributor

Will read more into it

@soulsam480
Copy link
Contributor

Well, yesterday VSCode stopped doing auto-imports from lodash package in my projects, so I guess the problem is only partially related to Quasar smile If you want to dig further and check out how we could make TS recognize transitional deps, that would help us out!

Is it possible to add vue as a dependency explicitly ? I did it and the types are working as expected. But is it ok to add vue as dependency even though it's inside quasar ?

@IlCallo
Copy link
Member

IlCallo commented Oct 14, 2021

Read up here why we cannot do this, at least for Qv2 lifecycle

That said, for sure you can install it on your project, but then you'd need to keep it in sync manually at each Vue/Quasar release, that's why we are searching for other ways to solve this problem which don't rely on adding all deps into the dev project package.json

@soulsam480
Copy link
Contributor

Read up here why we cannot do this, at least for Qv2 lifecycle

That said, for sure you can install it on your project, but then you'd need to keep it in sync manually at each Vue/Quasar release, that's why we are searching for other ways to solve this problem which don't rely on adding all deps into the dev project package.json

yes yes, got your point, keeping it synced manually is a tedious task. Also I don't think vue 3 has a @types/vue-next ts declarations package like vue 2, right ?

@IlCallo
Copy link
Member

IlCallo commented Oct 15, 2021

Nope... Which is good, but bad in this case
Anyway, I also noticed VSCode now started to suggest me vue symbols once I import the first one, which is an improvement, but I dunno if it's TS, VSCode or vue who allow for this now

@soulsam480
Copy link
Contributor

Nope... Which is good, but bad in this case Anyway, I also noticed VSCode now started to suggest me vue symbols once I import the first one, which is an improvement, but I dunno if it's TS, VSCode or vue who allow for this now

I'm also unsure.

@soulsam480
Copy link
Contributor

@IlCallo This is a workaround for now I think, and IMO this will solve the TS import issue without any hard work from you guys what do you think ? https://github.com/antfu/unplugin-auto-import check the quasar section

@IlCallo
Copy link
Member

IlCallo commented Oct 29, 2021

I'm honestly impressed by that package, but I don't think it's a good idea to enforce it to the whole community
Still searching for other workarounds which don't require any action taken from the end user

@soulsam480
Copy link
Contributor

I'm honestly impressed by that package, but I don't think it's a good idea to enforce it to the whole community
Still searching for other workarounds which don't require any action taken from the end user

Sorry I din't mean it that way, I suggested that it's a good workaround for now, till we we find something more reliable and less hack-ish.

@rstoenescu
Copy link
Member

Under the hood change in q/app v3.3 will make this work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants