Java 在 Eclipse 中更改 TODO

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/512235/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 15:35:45  来源:igfitidea点击:

Changing TODO in Eclipse

javaeclipse

提问by richs

In a eclipse a "//TODO" marks an area in code as a task for later consideration.

在 Eclipse 中,“//TODO”将代码中的一个区域标记为稍后考虑的任务。

Is there a way to add other expressions that will do the same. For example if i want to use "//myprojectname".

有没有办法添加其他表达式来做同样的事情。例如,如果我想使用“//myprojectname”。

采纳答案by benjismith

Window > Preferences > Java > Compiler > Task Tags

窗口 > 首选项 > Java > 编译器 > 任务标签

You can add new tags to your heart's content.

您可以为您的心脏内容添加新标签。



NOTE: Why the Eclipse guys made this a "Compiler" setting is beyond me. It just makes the setting hard for people to find, so it rarely gets customized.

注意:为什么 Eclipse 人员将其设为“编译器”设置超出了我的理解。它只会让人们难以找到设置,因此很少对其进行定制。

回答by Olaf Kock

The answers by benjismith and j pimmel are perfectly valid and correct. I just want to add that you can find this and other settings by using eclipse's neat preference-dialog feature:

benjismith 和 j pimmel 的答案是完全有效和正确的。我只想补充一点,您可以通过使用 eclipse 简洁的首选项对话框功能找到此设置和其他设置:

When you open the preferences dialog via "Window/Preferences", type "todo" in the text field in the upper left corner. The options tree will be limited to matching settings.

当您通过“窗口/首选项”打开首选项对话框时,在左上角的文本字段中键入“todo”。选项树将仅限于匹配设置。

Voilá

瓦伊拉

回答by Atul Kaushik

I did it like this on my Mac Machine,

我在我的 Mac 机器上是这样做的,

Eclipse>Preferences>Java>Compiler>Task Tags >New

Eclipse>Preferences>Java>Compiler>Task Tags>New

Now eneter the TAGand set it's Priority(viz. Normal, Lowor High).

现在输入TAG并设置它的优先级(即NormalLowHigh)。

Apply>OK

申请>确定

A dialog will popup and will ask you for a complete rebuild, tell it to rebuild now. You are good to go after a rebuild.

将弹出一个对话框并要求您进行完整的重建,告诉它现在重建。重建后你很高兴。