简体   繁体   English

从 PhpStorm / WebStorm 中的索引中排除文件夹

[英]Exclude folder from indexing in PhpStorm / WebStorm

Using PhpStorm 2017.3 to dev a node project;使用 PhpStorm 2017.3 开发节点项目; there are certain directories that I wish to exclude from indexing and auto-complete suggestions.我希望从索引和自动完成建议中排除某些目录。 I've seen elsewhere directions that I followed but still no dice.我在其他地方看到过我遵循的方向,但仍然没有骰子。 In the image below for example, the directory rxjs/add is one of them.例如,在下图中,目录rxjs/add就是其中之一。

在此处输入图片说明

On the left side of the image, you can see that in the Project tree view, the directory is not excluded;在图片的左侧,您可以看到在项目树视图中,没有排除目录; I get auto-complete suggestions from its contents.我从其内容中获得自动完成建议。 However when I go to Settings > Directories , the same folder (see the right side of the image) is already listed as excluded.但是,当我转到Settings > Directories ,相同的文件夹(请参见图像右侧)已被列为已排除。 Not sure what to do.不知道该怎么办。 This is a node_modules/ directory for the rxjs 5.5 package.这是rxjs 5.5包的node_modules/目录。

The problem I'm actually trying to solve: this library has multiple functions with the same name from different files.我实际上试图解决的问题是:这个库有多个来自不同文件的同名函数。 So when I use a function and the IDE tries to automatically add the ES6 import statement, it shows me multiple options and every time I have to carefully read the file paths to select the correct import.因此,当我使用一个函数并且 IDE 尝试自动添加 ES6 导入语句时,它会向我显示多个选项,并且每次我都必须仔细阅读文件路径以选择正确的导入。 Because the correct import always comes from the same two directories, I'd like to tell the IDE to stop looking into the others.因为正确的导入总是来自相同的两个目录,所以我想告诉 IDE 停止查看其他目录。

WebStorm/PhpStorm auto-exclude node_modules folder from the project, but direct project dependencies listed in package.json are added to JavaScript libraries for completion/navigation and thus indexed. WebStorm/PhpStorm 从项目中自动排除node_modules文件夹,但package.json中列出的直接项目依赖项被添加到JavaScript 库中以完成/导航并因此被索引。 To exclude certain module, you can comment it out in the package.json ;要排除某个模块,您可以在package.json中将其注释掉; or, in File |或者,在文件 | Settings |设置 | Languages & Frameworks |语言和框架 | JavaScript | JavaScript | Libraries , disable the <project_name>/node_modules library and create your own library (by pressing Add... ) with only desired modules/files included,禁用<project_name>/node_modules库并创建您自己的库(通过按Add... ),只包含所需的模块/文件

Open the IDE Settings > Directories -> Select the folders you want to exclude > click "Excluded" Button打开IDE设置>目录->选择要排除的文件夹>单击“排除”按钮

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM