从 Eclipse 的搜索结果中排除目标文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8213032/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exclude target folder from search results in Eclipse
提问by Mahmoud Saleh
I was wondering if it's possible to exclude targetfolder from eclipse quick search:
我想知道是否可以从eclipse 快速搜索中排除目标文件夹:
Ctrl+Shift+R
Ctrl+ Shift+R
If anyone knows how to do that, please advise.
如果有人知道如何做到这一点,请指教。
Update: I am using Maven 2, and M2E, WTPEclipse plug-ins.
更新:我正在使用Maven 2和M2E,WTPEclipse 插件。
回答by Chris
Mark the "target" folders as "derived" resource from the properties screen of those folders (this option is next to read only and archive property).
In the quick search (Ctrl+Shift+R) screen press the arrow in the top right corner and untick "Show derived resources".
从这些文件夹的属性屏幕中将“目标”文件夹标记为“派生”资源(此选项位于只读和存档属性旁边)。
在快速搜索 ( Ctrl+ Shift+ R) 屏幕中,按右上角的箭头并取消选中“显示派生资源”。
Then those target-files will not be considered in the quick search anymore.
那么这些目标文件将不再考虑在快速搜索中。
回答by nilan59
Go to Add Resource Filterpreferences dialog:
转到添加资源过滤器首选项对话框:
Go to Project
→ Properties
→ Resource
→ Resource Filters
前往Project
→ Properties
→ Resource
→Resource Filters
Click Add Filter...
点击 Add Filter...
Then fill the options:
然后填写选项:
Filter type:
过滤器类型:
(
?
)
Exclude all
(
?
)
排除所有
Applies to:
适用于:
(
?
)
Folders
(
?
)
文件夹
[
X
]
All children (recursive)
[
X
]
所有孩子(递归)
Filter and Folder Attributes:
过滤器和文件夹属性:
Name
- Matches
- [
target]
Name
- Matches
-[
目标]
回答by Dariusz
You can install AutoDeriv pluginfrom Eclipse Marketplace or http://nodj.github.io/AutoDeriv/. It allows you to create either global(workspace) or per-project .derived
files in which you can specify which files/folders should be marked as derived.
您可以从 Eclipse Marketplace 或http://nodj.github.io/AutoDeriv/安装AutoDeriv 插件。它允许您创建全局(工作区)或每个项目的文件,您可以在其中指定哪些文件/文件夹应标记为派生的。.derived
Here's a sample config file (taken from plugin's homepage):
这是一个示例配置文件(取自插件主页):
# set the 'target' and 'ext' folders as derived
target
ext
# but don't affect the 'keep' sub-folder
!target/keep
# all files with a '.dep' extension are generated
*.dep
src/include/version.h # this specific file is also generated.