-
Notifications
You must be signed in to change notification settings - Fork 25
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
Implement JetBrains web-types.json
file for Vue template type hinting
#33
Comments
Hi @BusterNeece, we provide types for the functions etc. here, these should be picked up by the IDE (VSCode Vue Language Features/Volar does this, Vetur should only be used for Vue 2 projects afaik). I'm unfamiliar with the JetBrains Vue integration, but it seems to work out of the box for one of our customers working in IDEA, so maybe there is some project configuration issue? I'll leave this open for now, so if others have the same issue they can notify us here. I probably wouldn't decline a PR but I would like to make sure that it really is something the package should provide. |
Perhaps it could be a misconfiguration on my part...on Vue single page component files, inside the template component, each of the $gettext calls look like this: Of course, anywhere I directly import |
Hi, we've been having the same issue with our project. We are in the middle of migrating to Vue 3.4 from 2.6. @lzurbriggen Actually I just found another post you made in the language tools repo - I found the same thing. I wonder if it would be OK to just update the type declarations in this repo to use |
Yes, we could do that. It feels like which one works changed a few times and I haven't delved deep enough into the Vue source to figure out why that could be. We're quite busy so please be patient if you open a PR, it could be a while until we get around to it. |
I've been implementing vue3-gettext in my application, and I've noticed that the
$gettext
calls in templates themselves, while they resolve correctly within Vue, are being treated by the JetBrains IDE as unknown function calls, which causes them to appear as warnings, show up in inspection results, etc...JetBrains has a standardized file type to define types in Vue component files (which is particularly useful for templates), and as long as such a file exists for it to reference, it'll be able to smartly identify the
$gettext
and other related function calls.The schema for this file is here: https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json
Another project, BootstrapVue, automatically generates this file (along with type-hinting for the VSCode Vetur extension) with this script: https://github.com/bootstrap-vue/bootstrap-vue/blob/dev/scripts/create-web-types.js
If there's interest in adding support for this, I'd be happy to look into possibly submitting a PR.
The text was updated successfully, but these errors were encountered: