通过项目在 Eclipse 中搜索
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4469014/
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
Search in Eclipse through project
提问by JaneNY
How to search in Eclipse through project for some word ? When I start CTRL-h I need to choose field, method or ...., but I need to find all occurences in project no metter method, field or .. ! How to achieve that ?
如何通过项目在 Eclipse 中搜索某个词?当我启动 CTRL-h 时,我需要选择字段、方法或 ....,但我需要在项目中找到所有出现的方法、字段或 ..!如何做到这一点?
回答by Moak
CTRL+ H-> File Search -> Containing Text 'some word'
make sure the scope is set to workspace or enclosing projects. Choosing Selected Resources will narrow the result set to the folder or file you selected in the explorer.
CTRL+ H-> 文件搜索 -> 包含文本 'some word'
确保范围设置为工作区或封闭项目。选择选定的资源会将结果集缩小到您在资源管理器中选择的文件夹或文件。
Further if you know the file type that might contain the text you can use the File Name patterns
with values like *.php, *.phtml, *.html
此外,如果您知道可能包含文本的文件类型,您可以使用File Name patterns
类似的值*.php, *.phtml, *.html
回答by keinabel
Ctrl+ Alt+ Gmight help finding Text in the new Version of Eclipse 3.7.
Ctrl+ Alt+G在Eclipse 3.7的新版本可能会帮助查找文本。
回答by william.eyidi
In order to accomplish it you need to customize your research:
为了完成它,您需要自定义您的研究:
Ctrl+ H
Ctrl+ H
then at the bottom of the search window click on Customize
然后在搜索窗口的底部点击 Customize
check only FileSearch
and unselect the rest of the options
仅FileSearch
选中并取消选择其余选项
then you can search for anywork in the project by selecting either worksapce
or Enclosing project
然后您可以通过选择worksapce
或搜索项目中的任何作品Enclosing project
回答by Andrejs
If you are using InstaSearch Eclipse pluginyou can easily filter searches by project:
如果您使用的是InstaSearch Eclipse 插件,您可以轻松地按项目过滤搜索:
proj:MyProjectName textToFind
proj:MyProjectName textToFind
or use ui to select a project to search in.
或使用 ui 选择要搜索的项目。