如何在 Eclipse 中启用 TODO/FIXME/XXX 任务标签?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4388292/
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
How do I enable TODO/FIXME/XXX task tags in Eclipse?
提问by Jeff
In all my years of using Eclipse, I never knew until now that TODO / FIXME / XXX comment tags are supposed to appear in the task list. Apparently this is something that is disabled by default because I have been using those tags for as long as I've been using Eclipse and I have never seen one of them appear in the task list. Can anyone indicate how to enable this feature? I see no preferences option anywhere that says anything to the effect of 'Let my source code tags appear in the task list'. It would be a nice feature if it existed, but I'm beginning to be doubtful.
在我使用 Eclipse 的所有岁月中,直到现在我才知道 TODO / FIXME / XXX 注释标签应该出现在任务列表中。显然,默认情况下这是禁用的,因为只要我一直在使用 Eclipse,我就一直在使用这些标签,而且我从未见过其中一个出现在任务列表中。谁能指出如何启用此功能?我在任何地方都没有看到任何首选项选项可以说明“让我的源代码标签出现在任务列表中”的效果。如果它存在,那将是一个很好的功能,但我开始怀疑。
I have asked around, and as others have suggested to me, these are some things which obviously have no effect but that I have tried anyway:
我问过周围,正如其他人向我建议的那样,这些显然没有影响但我已经尝试过的事情:
- Upgrading to the latest version of Eclipse.
- Restarting Eclipse.
- Closing and re-opening the task list.
- Refreshing the project.
- 升级到最新版本的 Eclipse。
- 重新启动 Eclipse。
- 关闭并重新打开任务列表。
- 刷新项目。
I am using:
Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1
Build id: 20100917-0705
我正在使用:
面向 Web 开发人员的 Eclipse Java EE IDE。
版本:Helios Service Release 1 版本号
:20100917-0705
回答by Gnoupi
For me, such tags are enabled by default. You can configure which task tags should be used in the workspace options: Java > Compiler > Task tags
对我来说,这些标签默认是启用的。您可以在工作区选项中配置应使用哪些任务标签:Java > Compiler > Task tags
Check if they are enabled in this location, and that should be enough to have them appear in the Task list (or the Markers view).
检查它们是否在此位置启用,这应该足以让它们出现在任务列表(或标记视图)中。
Extra note: reinstalling Eclipse won't change anything most of the time if you work on the same workspace. Most settings used by Eclipse are stored in the .metadata folder, in your workspace folder.
额外注意:如果您在同一个工作区工作,重新安装 Eclipse 在大多数情况下不会改变任何东西。Eclipse 使用的大多数设置都存储在工作区文件夹中的 .metadata 文件夹中。
回答by jvdbogae
In the distribution I use, the tasks are listed in the task list by default (at least for Java). For other content types, you may check the following settings.
在我使用的发行版中,任务默认列在任务列表中(至少对于 Java)。对于其他内容类型,您可以检查以下设置。
Display the Tasks View: Window > Show View > Other > General > Tasks
显示任务视图:窗口 > 显示视图 > 其他 > 常规 > 任务
For non-Java Task Tags: check the following settings: Window > Preferences > General > Editors > Structured Text Editors > Task Tags You can enable searching for task tags in the [Task Tags] tab and select the content types in the [Filters] tab.
对于非 Java 任务标签:检查以下设置:窗口 > 首选项 > 常规 > 编辑器 > 结构化文本编辑器 > 任务标签 您可以在 [任务标签] 选项卡中启用搜索任务标签,并在 [过滤器] 中选择内容类型标签。
For Java task tags, you should look in: Window > Preferences > Java > Compiler > Task Tags
对于 Java 任务标签,您应该查看:Window > Preferences > Java > Compiler > Task Tags
J.
J。
回答by styanton
I'm using Eclipse Classic 3.7.1.
我正在使用 Eclipse Classic 3.7.1。
The solution is: Window > Preferences > General > Editors > Sctructured Text Editors > Task Tags and checking "Enable searching for Task Tags" checkbox.
解决方案是:窗口 > 首选项 > 常规 > 编辑器 > 结构化文本编辑器 > 任务标签并选中“启用搜索任务标签”复选框。
回答by davidbourguignon
All those settings are necessary to choose which tags you are interested in, but in order to display these tags in a list, you also need to select the right Eclipse perspective. I finally discovered that the "Markers" tab containing the "Task" list is only available under the "Java EE" perspective... Hope this helps! :-)
所有这些设置都是选择您感兴趣的标签所必需的,但是为了在列表中显示这些标签,您还需要选择正确的 Eclipse 透视图。我终于发现包含“任务”列表的“标记”选项卡仅在“Java EE”视角下可用......希望这会有所帮助!:-)
回答by Dave DuPlantis
There are apparently distributions or custom builds in which the ability to set Task Tags for non-Java files is not present. This postmentions that ColdFusion Builder (built on Eclipse) does not let you set non-Java Task Tags, but the beta version of CF Builder 2 does. (I know the OP wasn't using CF Builder, but I am, and I was wondering about this question myself ... because he didn't see the ability to set non-Java tags, I thought others might be in the same position.)
显然有一些发行版或自定义版本不存在为非 Java 文件设置任务标签的能力。这篇文章提到 ColdFusion Builder(构建在 Eclipse 上)不允许您设置非 Java 任务标签,但 CF Builder 2 的测试版可以。(我知道 OP 没有使用 CF Builder,但我是,我自己也在想这个问题......因为他没有看到设置非 Java 标签的能力,我认为其他人可能也有同样的问题位置。)