How can I configure WebStorm to provide code compl

2019-02-22 07:08发布

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?

enter image description here

标签: WebStorm koa
4条回答
贪生不怕死
2楼-- · 2019-02-22 07:27

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

查看更多
▲ chillily
3楼-- · 2019-02-22 07:45

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/

查看更多
一纸荒年 Trace。
4楼-- · 2019-02-22 07:48

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

查看更多
甜甜的少女心
5楼-- · 2019-02-22 07:52

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

查看更多
登录 后发表回答