Question

is there any available intellisense for Webstorm for Sails.js app? In all my controllers, I get message that the model is undefined, even though it works perfectly. The same goes with calling services.

Was it helpful?

Solution 2

This framework is not currently supported - please vote for http://youtrack.jetbrains.com/issue/WEB-11025. And WebStorm doesn't support its way of loading modules and thus can't provide intellisense

OTHER TIPS

i know this is a little old, but what i ended up doing was first naming all "modules.exports" definitions with the same name of the file (like a class name).

So if i have a file named UserController.js, i would start it with:

var UserController = module.exports = {}

Next, you need to go to the preferences page and hook up your sails api folder as a library. javascript libraries settings page

  • Just go Preferences->Languages and Frameworks->Javascript->Libraries
  • Click add
  • Click the little + icon on the left bottom part of the dialog
  • Browse to the sails api folder (where your controllers and models are)
  • Click OK

You will notice that the icon for api files now has some books on them.

Also, make sure that your "Node.js Globals" is enabled as well as the "node_modules" folder of your sails project. that will enable code completion on common node.js stuff and on sails dependencies (waterline, ejs, etc).

Hope that helps and vote for official support!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top