简体   繁体   English

Eclipse CDT-了解所有文件都包含头文件的快捷方式?

[英]Eclipse CDT - shortcut to know which all files include a header file?

I have a big project. 我有一个大项目。 I want to find which all .cpp/.h files include file1.h in them. 我想找到所有.cpp / .h文件中都包含file1.h文件。 Is there any shortcut key in Eclipse CDT to do this? Eclipse CDT中是否有任何快捷键可以执行此操作?

I'd suggest the Include Browser view. 我建议使用“包含浏览器”视图。 You can drag a file in there and you get a nice tree which shows all files that include your file, including indirect includes. 您可以将文件拖到其中,您会得到一棵漂亮的树,其中显示了包含文件的所有文件,包括间接包含。

In Eclipse, under the search menu, the entry File... exists. 在Eclipse中,在搜索菜单下,存在File... Searching there for #include*"file1.h" should do the trick. 在那里搜索#include*"file1.h"应该可以解决问题。

Optimization suggestions: Preferences->General->Keys , search for file search then add the binding Ctrl+H for it. 优化建议: Preferences->General->Keys ,搜索file search然后为其添加绑定Ctrl+H This is by default mapped to C/C++ Search , so you will have to remove the prior binding or use another hotkey. 默认情况下,这已映射到C/C++ Search ,因此您将必须删除先前的绑定或使用另一个热键。

If you want to go the extra mile, check out Practically Macro . 如果您想加倍努力,请查看Practically Macro It should be straight forward to make a "Search including files" macro with it. 应该直接使用它来创建“搜索包括文件”宏。

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

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