mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Feature request: custom command intellisense? #42

Closed fearhq closed 3 years ago

fearhq commented 3 years ago

I have noticed that custom command autocomplete works, but intellisense doesn't (highlighted as invalid/method expression not a function) Is it possible to enable intellisense for these cases? If not, is there a workaround?

Thank you for your hard work on this plugin!

mbolotov commented 3 years ago

I suppose you are using custom commands in plain JS with no type definitions for the commands, right? So a workaround (better to say the right way) is to define types for you commands. See here for details. Is this approach acceptable for you?

mbolotov commented 3 years ago

Hey, @fearhq! Do you have a chance to try using type definitions?

fearhq commented 3 years ago

Hello @mbolotov ! I have attempted to add type definitions inside my project, but have gotten a bit confused, since my project is not a typescript project. I have attempted to create type definitions, but cannot get them to load

mbolotov commented 3 years ago

you could try the 2.0 version of the plugin. It can automate generation of type definitions for your commands. see here: https://youtu.be/nCIgdCcPamM

mbolotov commented 3 years ago

closing this as IDE supports this feature via TypeScript definitions, see here And the plugin make it easy to use this feature: https://youtu.be/nCIgdCcPamM