如何配置WebStorm / PhpStorm项目,以便JS代码智能适用于Node.js项目?

问题描述:

在WebStorm / PhpStorm / IDEA中,内置了JavaScript的代码智能功能相当多。但是,在开发Node.js应用程序时,包括来自 node_modules 的所有内容>使导航到文件之类的问题复杂化(我不希望IDE从 node_modules package.json s / code>文件夹,例如)。但是排除 node_modules 文件夹完全有其自身的问题 - 没有代码完成等。

In WebStorm / PhpStorm / IDEA, there are quite a lot of code intelligence feature for JavaScript built in. However, when developing a Node.js application, including everything from node_modules complicates matters with things like "Navigate to file" (I don't want the IDE to offer me tens of package.jsons from node_modules folder, for example). But excluding the node_modules folder entirely has its own problems - there is no code completion etc.

那么什么是对在WebStorm中接近这个的方法?我应该只包含 node_modules 中的一些文件吗?或者从那里排除所有内容并以某种方式使用项目或全局库的概念?

So what's the "right" way to approach this in WebStorm? Should I include only some of the files from node_modules? Or exclude everything from there and somehow use the concept of project or global libraries?

谢谢。

这已在WebStorm 7中修复,请参阅 http:// youtrack。 jetbrains.com/issue/WEB-1927

This has been fixed in WebStorm 7, see http://youtrack.jetbrains.com/issue/WEB-1927.