简体   繁体   English

WebStorm,PHPStorm,Jetbrains IDEs - 忽略Typescript项目中的JS和MAP文件

[英]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.

相关问题 如何在处理Angular2-typescript项目时隐藏WebStorm中的.js和.map文件 - How to hide .js and .map files in WebStorm while working on Angular2-typescript project 如何在 WebStorm / PhpStorm 中自动按字母顺序对 TypeScript 文件的导入进行排序? - How to sort imports alphabetically for TypeScript files automatically in WebStorm / PhpStorm? 配置WebStorm / PhpStorm将.ts文件编译为.js到“js”文件夹 - Configure WebStorm/PhpStorm to compile .ts files to .js into “js” folder 使用phpstorm或webstorm进行TypeScript单元测试 - Unit Testing TypeScript with phpstorm or webstorm PhpStorm/WebStorm ESLint 自动修复 TypeScript - PhpStorm/WebStorm ESLint autofix TypeScript 如何使用JetBrains WebStorm自动完成TypeScript界面 - How to autocomplete TypeScript interface with JetBrains WebStorm 如何强制 WebStorm 不忽略 JavaScript 文件中的 TypeScript 见解? - How to enforce WebStorm not to ignore TypeScript insights in JavaScript files? TypeScript:如何从项目中删除* .js.map文件 - TypeScript: how to delete the *.js.map files from the project .Net Core和Typescript:如何指示TFS忽略生成的js和js.map文件 - .Net Core and Typescript: how to instruct TFS to ignore generated js and js.map files WebStorm / PhpStorm中的TypeScript文件中的jQuery方法自动完成 - jQuery methods autocomplete in a TypeScript file in WebStorm / PhpStorm
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM