Eclipse自动添加todo任务
Eclipse 有没有办法自动添加 TODO 任务,例如:- //TODO: TO BE TESTED
到函数或类的顶部,以便我可以轻松跟踪尚未测试的更改?
Is there a way in eclipse to automatically add TODO task eg:- //TODO: TO BE TESTED
to the top of the function or class so that i can easily keep track of the changes yet to be tested ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您想在生成方法/类时添加 TODO 吗?然后您可以使用代码模板来实现这一点。就像在生成方法时添加
// TODO 自动生成的方法存根
一样,您可以将任何其他注释放在方法之上。窗口
->首选项
->Java
->代码风格
->代码模板
或者您想将 TODO 添加到当前存在的所有方法/类中吗?这有点难,你可以编写一个插件来为你做到这一点: Eclipse JDT
如果在修改类或方法时应始终创建 TODO,您还可以编写一个 eclipse 插件来监视编辑器中的
CompilationUnit
。请参阅recordModifications()
此处Do you want to add the TODO when you generate the methods/classes? Then you could use code templates for that. Like
// TODO Auto-generated method stub
is added when you generate a method you could put any other comment on top of a method.Window
->Preferences
->Java
->Code Style
->Code Templates
Or do you want to add the TODO to all methods/classes which currently do exist? Thats a bit harder, you could write a plugin which does that for you: Eclipse JDT
If that TODO should always be created when you have modified a class or method you could also write an eclipse plugin which monitors the
CompilationUnit
in the editor. SeerecordModifications()
here您可以编辑代码模板并在其中包含 TODO 注释。代码模板位于首选项对话框中
不幸的是,这只会对新方法和类有帮助。
You can edit the code templates and include the TODO comment there. Code templates are located on the preferences dialog
Unfortunately, this will only help for new methods and classes.