eclipse IDE 注释关键字

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

IDE comment keywords

eclipseidecommentsrubyminetodo

提问by OVERTONE

So I only recently discovered the TODO comment. For those of you that don't know, most modern IDE's will recognize this word in a comment and flag the comment line a different colour so It stands out.

所以我最近才发现 TODO 评论。对于那些不知道的人,大多数现代 IDE 会在注释中识别这个词,并将注释行标记为不同的颜色,以便它脱颖而出。

EG.

例如。

//Need to talk to Bill about refactoring this code

//TODO:Need to talk to Bill about refactoring this code

You may notice in IDE's like Eclipseor Rubyminehighlight the TODO comment and some nice other features to do with it.

您可能会注意到在EclipseRubymine等 IDE 中突出显示了 TODO 注释和一些与之相关的其他不错的功能。

My question is: What other keywords are there like the TODO? It seems like a much better way of communicating to developers through comments and a feature that should be a bit more widely known in IDE's. Their purpose is to help with development after all..

我的问题是:像 TODO 一样还有哪些其他关键字?这似乎是一种更好的通过评论与开发人员交流的方式,以及在 IDE 中应该更广为人知的功能。毕竟他们的目的是帮助发展。

回答by rlegendi

I can speak of Eclipse, you can customize it.

我可以说 Eclipse,你可以自定义它。

Click on Window -> Preferences, and search for General -> Editors -> Structured Text Editors -> Task tags, or for Java -> Compiler -> Task tags(there might be some additional ones like for JavaScript, PHP, StatET, etc.)

单击Window -> Preferences,然后搜索General -> Editors -> Structured Text Editors -> Task tags,或搜索Java -> Compiler -> Task 标签(可能还有一些其他标签,如 JavaScript、PHP、StatET 等) .)

TODO, FIXME, XXX

I use some additional ones like:

我使用了一些额外的,比如:

CHECKME, DOCME, TESTME, PENDING

I personally like to use the DISCUSS/REVIEWtags just to make sure I speak about some issue with someone during a code review or pair programming (e.g., I haven't misunderstood the specification how something should work etc.).

我个人喜欢使用DISCUSS/REVIEW标签只是为了确保我在代码或结对编程期间与某人谈论一些问题(例如,我没有误解某些东西应该如何工作等的规范)。

You can also set the prioritiesassigned to the different task tags there too.

您还可以在那里设置分配给不同任务标签的优先级

回答by helloworld922

These are known as task tags. In Eclipse they are TODO, FIXME, and XXX.

这些被称为task tags. 在Eclipse他们TODOFIXMEXXX

However, Eclipse allows you to modify the available list of task tags. Go to preferences> Java> Compiler> Task Tags

但是,Eclipse 允许您修改可用的任务标记列表。前往preferences> Java> Compiler>Task Tags

Here you can modify the available list of task tags, change their priority, and decide if task tags should be case sensitive or not.

您可以在此处修改可用的任务标签列表,更改其优先级,并决定任务标签是否应区分大小写。

回答by John R Perry

To add custom TODO tags in IntelliJgo to:

要在IntelliJ 中添加自定义 TODO 标签,请转到:

Preferences > Editor > TODO

首选项 > 编辑器 > TODO

回答by Rodrigo

In Eclipse Oxygen 4.7.2 for C/C++ the task tags are configured in Windows -> Preferences -> C/C++ -> Task Tags.

在 Eclipse Oxygen 4.7.2 for C/C++ 中,任务标签在 Windows -> Preferences -> C/C++ -> Task Tags 中配置。

You can also enable searching for task tags as @rlegendi answer.

您还可以启用搜索任务标签作为@rlegendi 答案。

回答by user1242756

Patterns like TODO, FIXME are default in NetBeans as ToDo keywords. You can also add any keyword you want in Tools > Options > Miscellaneous > Tasks.

像 TODO、FIXME 这样的模式在 NetBeans 中默认为 ToDo 关键字。您还可以在“工具”>“选项”>“其他”>“任务”中添加所需的任何关键字。

回答by noname noname

for enabling/disabling code formatter use: // @formatter:on // @formatter:off

启用/禁用代码格式化程序使用: // @formatter:on // @formatter:off