Currently, WebStorm reports that KoaJS's methods are undefined. It's a minor, yet persistent annoyance. I've searched on the net and I've searched through WebStorm's configuration dialogs to no avail.
Does anyone use WebStorm with KoaJS and have intellisense/code completion working properly?
It's a known bug, please follow WEB-11299 for updates
Doing either File > Settings > Languages & Frameworks > JavaScript > Libraries
or Click the face in the bottom right corner of the IDE > Libraries in scope
. You can Add
new libraries that are used for highlighting and code completion. If you are using NPM it's handiest to just add the entire node_modules
directory so WebStorm will know about any other packages you install. Or if you don't want to do that, or you don't use NPM, you can just add the koa
directory.
Depending on how you create your project I think WebStorm can automatically add the node_modules
directory. At least some of my projects have done so without me explicitly doing this.
A bit more reading: http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/
Mac Webstorm 2016.1.1
The following are valid:
Preferences -> Languages & Frameworks -> Javascript -> Libraries -> Download -> Typescript community stubs -> Find koa library -> Download and install -> Apply
worked picture
use new koa()
instead(with typescript installed),worked for my Intellij IDEA 2016.3.4