[英]WebStorm, PHPStorm, Jetbrains IDEs - Ignore JS and MAP files in Typescript Project
Is there a way to ignore *.js
and *.js.map
in TypeScript project in Jetbrains IDEs ? 有没有办法在Jetbrains IDE中忽略TypeScript项目中的
*.js
和*.js.map
?
Right now, I have a TypeScript project in my PHPStorm and when searching for a file ctrl+shift+N
I get all files - *.ts, *.js, *.js.map
Which forces me to select one the typescript file everytime I search, instead of just quickly jumping to file. 现在,我的PHPStorm中有一个TypeScript项目,当搜索文件
ctrl+shift+N
我得到所有文件 - *.ts, *.js, *.js.map
这迫使我每次都选择一个打字稿文件我搜索,而不是只是快速跳转到文件。
Is there a way to filter compiled files from search? 有没有办法从搜索过滤编译的文件? I tried scopes etc, but it doesn't do the trick.
我尝试了范围等,但它没有做到这一点。
PS: I know working on TypeScript it would be recommended to use WebStorm, but I find that PHPStorm gives me the best experience out of their products. PS:我知道在TypeScript上工作会建议使用WebStorm,但我发现PHPStorm给了我最好的产品体验。
Actually this functionality is included in my PhpStorm 2016.2 installation on Linux, but I would assume it's not different than in other operating systems as it's cross-platform. 实际上这个功能包含在我在Linux上的PhpStorm 2016.2安装中,但我认为它与其他操作系统没有区别,因为它是跨平台的。
Option 1: There should be a filter button at the Ctrl+Shift+N
file search dialog at the right top. 选项1:右上角的
Ctrl+Shift+N
文件搜索对话框中应该有一个过滤按钮。 you can directly deselect JavaScript files and from now on they won't show up in the search anymore.
您可以直接取消选择JavaScript文件,从现在开始,它们将不再显示在搜索中。 As
*.map
is not registered as file type by default you won't find it in the list (at least not on my installation). 由于
*.map
默认情况下未注册为文件类型,因此您无法在列表中找到它(至少在我的安装中没有找到它)。 To achieve also *.map
filtering register the filetype Settings -> Editor -> File Types -> "Recognized File Types"
add a new file type with the name map - no more options needed - and add as "Registered Pattern" *.map
(you can see this in action also in picture 2). 要实现
*.map
过滤注册文件类型Settings -> Editor -> File Types -> "Recognized File Types"
添加名称为map的新文件类型 - 不再需要选项 - 并添加为“已注册模式” *.map
(你可以在图2中看到这一点)。 Now this file type should be available for excluding from search too. 现在,此文件类型也可用于从搜索中排除。
Option 2: You can hide *.js
files as well as *.map
files totally from your project by Settings -> Editor -> File Types -> "Ignore files and folders"
add here *.js;*.map;
选项2:您可以通过
Settings -> Editor -> File Types -> "Ignore files and folders"
来完全隐藏*.js
文件以及*.map
文件*.js;*.map;
这里添加*.js;*.map;
*.map
*.js;*.map;
from now on these file types won't not just be hidden in the project but also not showing up on file search (Ctrl+Shift+N).
从现在开始,这些文件类型不仅不会隐藏在项目中,也不会显示在文件搜索上(Ctrl + Shift + N)。 If you need to check your JS and map files you could open a second editor for such cases, but I think you wouldn't need to do that too often, right?
如果你需要检查你的JS和地图文件你可以为这种情况打开第二个编辑器,但我认为你不需要经常这样做,对吧?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.