Eclipse CDT 移动文件和重命名文件重构?
Eclipse CDT 中有没有办法进行以下自动重构?
- 移动文件:将源文件/头文件移动到另一个项目文件夹,并自动更新与移动文件相关的每个#include指令
- 重命名文件:重命名源文件/头文件,并自动更新与重命名文件相关的每个 #include 指令
如果 CDT 中没有这样的功能,是否有其他 Linux 工具可以轻松地让我做到这一点?
非常感谢。
Is there a way in Eclipse CDT to do the following automatic refactorings?
- move file: move a source/header file to another project folder and have every #include directive relative to the moved file automatically updated
- rename file: rename a source/header file and have every #include directive relative to the renamed file automatically updated
If there is no such feature in CDT, is there another tool for Linux that would easily let me do this?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 CDT 8.0 中找不到这些功能。我建议在 https://bugs.eclipse.org/ 提出功能请求bugs/enter_bug.cgi?product=CDT。
我刚刚做了一堆你的第 2 项。(头文件重命名、#include 重命名、include-guard 重命名)。使用 eclipse 的搜索和替换大约需要 3 分钟。考虑到我以前从未这样做过,这还不错。如果在 CDT 中实现“头文件重命名”,这可能需要不到一分钟的时间。在我看来,这并不是一个很大的节省,尤其是当你考虑到这样做的频率有多低时。但随后,我不得不重命名约 20 个文件。我使用的半手动方法可能无法像 CDT refactor impl 那样扩展。
I have not been able to find either of these features in CDT 8.0. I would suggest putting in a feature request at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT.
I just did a bunch of your item 2. (header file renaming, #include renaming, include-guard renaming). This took about 3 minutes using eclipse's Search and Replace. Not bad considering I've never done it before. Presumably this might have taken under a minute if "header file rename" was implemented in CDT. Not a big savings, in my book, esp when you consider how infrequently this is done. But then, I had to rename ~20 files. The semi-manual approach I used wouldn't scale as well as CDT refactor impl probably would.