Defining store with id as first parameter instead of inside options breaks WebStorm Intellisense in Vue templates #774
Replies: 5 comments 5 replies
-
I don't use WebStorm so I won't be able to help with this but I doubt there is anything to do on Pinia's code as it's just TypeScript. Maybe WebStorm is not using an up to date version of TS? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the replyt. I tried updating to the latest version of WebStorm but that did not fix it. I will try to raise the issue with JetBrains directly. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks, this was one of the reasons autocompletion wasn't working in PHPStorm / WebStorm. I also had to export |
Beta Was this translation helpful? Give feedback.
-
I have noticed a whole bunch of issues with types in WebStorm. This is really confusing as they are using the TypeScript Language Service to get their type information. I have never seen any issue with Angular. This stuff is only happening in vue projects. Here's an example of one of the bugs I have reported: https://youtrack.jetbrains.com/issue/WEB-52619 I recommend you create an issue in their tracker as well. Maybe they'll finally work on a fix if enough people complain... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
Using WebStorm IDE, using
defineStore()
function to define a store using id as the first parameter and options object as second makes WebStorm not see any of the internal properties, getters, or actions in Intellisense when used in vue templates, it only sees the internal store values. In the script section, everything works as intended. Moving id into the options object makes Intellisense behave as expected.Steps to reproduce the behavior
<h1> {{ myStore.myVal }} </h1>
Expected behavior
WebStorm will see and recognize my defined values of the store alongside the internal ones.
Actual behavior
WebStorm only sees internal store values
Additional information
I verified the problem exists using the latest Pinia version when using the new defineStore syntax. Moving the id back to the options menu as in the old syntax does not suffer from this problem.
See discussion: #531
Beta Was this translation helpful? Give feedback.
All reactions