Skip to content

Support for Volar (AKA Vue Language Tools) in VS Code, vue-tsc, etc #1075

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

Open
segevfiner opened this issue Jan 1, 2024 · 6 comments
Open

Comments

@segevfiner
Copy link

segevfiner commented Jan 1, 2024

It seems types are currently missing for NativeScript components
image

This is also was is used by vue-tsc to type check a project. It would be nice if those types are registered. This might require a transform of the NativeScript type to something that Volar/Vue Language Tools can understand, a "fake" Vue component type, a web component like type, or something else, or maybe teaching Vue Language Tools to recognize NativeScript component types directly.

Without this you can't type check the project properly and you get no completions in the IDE for the NativeScript components.

@rigor789
Copy link
Member

rigor789 commented Jan 2, 2024

There's a community package that I believe adds all the correct types, see https://www.npmjs.com/package/@nativescript-dom/vue-types

@segevfiner
Copy link
Author

Neat. Those are manually typed, but I guess it's up to NativeScript to supply builtin types at some point. Maybe this is something to add to the templates and/or docs? It's kind of jarring generating a new project and having no types for stuff.

@vallemar
Copy link
Contributor

vallemar commented Jan 2, 2024

@segevfiner I think the same, I think this should be in the templates

@PixsaOJ
Copy link

PixsaOJ commented Aug 26, 2024

@rigor789 That package does not work for me

@PixsaOJ
Copy link

PixsaOJ commented Sep 2, 2024

I had this working, was going comment the solution, but now its gone. Definietly possible if you have right references.d.ts and include type libraries in tsconfig

maybe you also need @vue/typescript-plugin ?

@PixsaOJ
Copy link

PixsaOJ commented Sep 3, 2024

Use tsserver (typescript-language-server) with @vue/typescript-plugin

Due to volar version mismatch to @vue/typescript-plugin, it might not work in different editors.

Somehow, upgrading to 2.1.4 breaks types, but when i try to revert it back, it does not come back. I tried not touching other plugins. removing pnpm-lock. Don't know what is happening.

Before i was able to make it work both in vscode setup and neovim. now, its just neovim (probably because of different configuration)

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

No branches or pull requests

4 participants