Eclipse CDT - 知道所有文件包含头文件的快捷方式?

时间:2021-03-22 15:07:48

I have a big project. I want to find which all .cpp/.h files include file1.h in them. Is there any shortcut key in Eclipse CDT to do this?

我有一个大项目。我想找到所有.cpp / .h文件中包含file1.h的文件。 Eclipse CDT中是否有任何快捷键来执行此操作?

2 个解决方案

#1


3  

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.

我建议包括浏览器视图。你可以在那里拖动一个文件,你会得到一个漂亮的树,它显示包含你文件的所有文件,包括间接包含。

#2


0  

In Eclipse, under the search menu, the entry File... exists. Searching there for #include*"file1.h" should do the trick.

在Eclipse中,在搜索菜单下,条目File ...存在。在那里搜索#include *“file1.h”应该可以解决问题。

Optimization suggestions: Preferences->General->Keys, search for file search then add the binding Ctrl+H for it. This is by default mapped to C/C++ Search, so you will have to remove the prior binding or use another hotkey.

优化建议:首选项 - >常规 - >键,搜索文件搜索,然后为其添加绑定Ctrl + H.这默认映射到C / C ++ Search,因此您必须删除先前的绑定或使用其他热键。

If you want to go the extra mile, check out Practically Macro. It should be straight forward to make a "Search including files" macro with it.

如果您想加倍努力,请查看实际宏。用它来制作“搜索包含文件”宏应该是直截了当的。

#1


3  

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.

我建议包括浏览器视图。你可以在那里拖动一个文件,你会得到一个漂亮的树,它显示包含你文件的所有文件,包括间接包含。

#2


0  

In Eclipse, under the search menu, the entry File... exists. Searching there for #include*"file1.h" should do the trick.

在Eclipse中,在搜索菜单下,条目File ...存在。在那里搜索#include *“file1.h”应该可以解决问题。

Optimization suggestions: Preferences->General->Keys, search for file search then add the binding Ctrl+H for it. This is by default mapped to C/C++ Search, so you will have to remove the prior binding or use another hotkey.

优化建议:首选项 - >常规 - >键,搜索文件搜索,然后为其添加绑定Ctrl + H.这默认映射到C / C ++ Search,因此您必须删除先前的绑定或使用其他热键。

If you want to go the extra mile, check out Practically Macro. It should be straight forward to make a "Search including files" macro with it.

如果您想加倍努力,请查看实际宏。用它来制作“搜索包含文件”宏应该是直截了当的。