eclipse 为什么eclipse IDE中Java注释中的“XXX”字样特殊?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15220551/
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
Why "XXX" word in Java comment in eclipse IDE take a special style?
提问by ahmednabil88
When i write a Java comment in Eclipse IDE containning "XXX" word
Like that
当我写在Eclipse IDE containning“XXX”字样一个Java注释
就像那个
// Increment
// XXX => Not like that [ x = x++; ]
// OK => BUT like that [ x++; ]
The "XXX" word take a style which is different a normal comment style
Its color will be (Blue color) NOT (Green color)
“XXX”字采用与普通评论风格不同的风格
它的颜色将是(蓝色)而不是(绿色)
Note
"XXX" comment color is like that "TODO" comment color
Like
注意
“XXX”评论颜色和“TODO”评论颜色
一样
// XXX color like TODO color
Why that ?
为什么 ?
回答by Tom Anderson
XXX is sometimes used as a tag for bugs or other bad stuff. Eclipse recognises various kinds of tags in comments, and highlights them. TODO and FIXME are other examples that spring to mind.
XXX 有时用作错误或其他坏东西的标签。Eclipse 可以识别注释中的各种标签,并突出显示它们。TODO 和 FIXME 是其他令人想到的例子。
It's configured under Java > Compiler > Task Tags in the preferences.
它在首选项中的 Java > Compiler > Task Tags 下配置。
A way to make use of this is with the Tasks view; this lists all the occurrences of such tags in your code, and lets you jump to them. It's handy as a super-lightweight micro-task tracking system.
使用它的一种方法是使用 Tasks 视图;这列出了代码中所有出现的此类标签,并让您跳转到它们。作为超轻量级的微任务跟踪系统,它非常方便。
回答by alestanis
In Eclipse, you can define special words that have a meaning. XXX
is defined in the same place as the TODO
word, it's an Eclipse default, but you can remove it.
在 Eclipse 中,您可以定义具有含义的特殊词。XXX
定义在与TODO
单词相同的位置,它是 Eclipse 的默认值,但您可以将其删除。
回答by PSR
A marker that attention is needed. Commonly used in program comments to indicate areas that are kluged up or need to be. Some hackers liken `XXX' to the notional heavy-porn movie rating. Compare FIXME.
需要注意的标记。常用于程序注释中,以指示已拼凑或需要拼凑的区域。一些黑客将“XXX”比作名义上的重电影评级。比较 FIXME。
回答by tmwanik
XXX
is used as a task tag in eclipse for comments, it has a priority of normal. Other tags include TODO
(Normal), FIXME
(High). It can be used to mark section of your code that need attention, later review and also communicate what should be done, some of these are tasks you would like to handle at a later stage. More here
XXX
在eclipse中作为task标签用于注释,优先级为normal。其他标签包括TODO
(正常)、FIXME
(高)。它可用于标记需要注意的代码部分,稍后进行并传达应该做什么,其中一些是您希望在稍后阶段处理的任务。更多在这里