How can I configure WebStorm to provide code completion for KoaJS?

爷,独闯天下 提交于 2020-01-11 08:46:31

问题


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?


回答1:


It's a known bug, please follow WEB-11299 for updates




回答2:


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/




回答3:


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




回答4:


use new koa() instead(with typescript installed),worked for my Intellij IDEA 2016.3.4



来源:https://stackoverflow.com/questions/32085988/how-can-i-configure-webstorm-to-provide-code-completion-for-koajs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!