IDE 注释关键字

2022-01-20 00:00:00 comments ide eclipse rubymine todo

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

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.

EG.

//Need to talk to Bill about refactoring this code

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

您可能会注意到像 Eclipse 或 Rubymine 突出显示 TODO 注释和其他一些不错的功能.

You may notice in IDE's like Eclipse or Rubymine highlight the TODO comment and some nice other features to do with it.

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

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..

推荐答案

我会说 Eclipse,你可以自定义它.

I can speak of Eclipse, you can customize it.

点击Window -> Preferences,然后搜索General -> Editors -> Structured Text Editors -> Task tags,或Java -> Compiler-> 任务标签(可能还有一些额外的标签,如 JavaScript、PHP、StatET 等)

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.)

TODO, FIXME, XXX

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

I use some additional ones like:

CHECKME, DOCME, TESTME, PENDING

我个人喜欢使用 DISCUSS/REVIEW 标签,以确保我在代码审查或结对编程期间与某人谈论某些问题(例如,我没有'不要误解规范应该如何工作等).

I personally like to use the DISCUSS/REVIEW tags 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.).

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

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

相关文章