如何在 Eclipse 中启用 TODO/FIXME/XXX 任务标签?
在我使用 Eclipse 的这些年里,直到现在我才知道 TODO / FIXME / XXX 注释标签应该出现在任务列表中。显然,默认情况下这是禁用的,因为只要我使用 Eclipse,我就一直在使用这些标签,而且我从未见过其中一个出现在任务列表中。谁能指出如何启用此功能?我在任何地方都没有看到任何首选项选项显示“让我的源代码标签出现在任务列表中”的效果。如果存在的话,这将是一个很好的功能,但我开始怀疑。
我四处询问,正如其他人向我建议的那样,这些事情显然没有效果,但我还是尝试过:
- 升级到最新版本的 Eclipse。
- 重新启动 Eclipse。
- 关闭并重新打开任务列表。
- 刷新项目。
我正在使用:
面向 Web 开发人员的 Eclipse Java EE IDE。
版本:Helios 服务版本 1
内部版本号:20100917-0705
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.
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.
I am using:
Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1
Build id: 20100917-0705
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对我来说,默认情况下启用此类标签。您可以在工作区选项中配置应使用哪些任务标签:Java >编译器>任务标签
检查它们是否在此位置启用,这应该足以让它们出现在任务列表(或标记视图)中。
额外注意:如果您在同一个工作区中工作,则大多数情况下重新安装 Eclipse 不会改变任何内容。 Eclipse 使用的大多数设置都存储在工作区文件夹中的 .metadata 文件夹中。
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
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.
在我使用的发行版中,任务默认列在任务列表中(至少对于 Java 而言)。对于其他内容类型,您可以检查以下设置。
显示任务视图:
窗口>显示视图>其他>一般>任务
对于非 Java 任务标签:检查以下设置:
窗口>首选项>一般>编辑>结构化文本编辑器>任务标签
您可以在[任务标签]选项卡中启用搜索任务标签,并在[过滤器]选项卡中选择内容类型。
对于 Java 任务标签,您应该查看:
窗口>首选项>爪哇>编译器>任务标签
J.
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.
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.
For Java task tags, you should look in:
Window > Preferences > Java > Compiler > Task Tags
J.
我正在使用 Eclipse Classic 3.7.1。
解决办法是:窗口>首选项>一般>编辑>结构化文本编辑器>任务标签并选中“启用任务标签搜索”复选框。
I'm using 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.
所有这些设置都是选择您感兴趣的标签所必需的,但为了在列表中显示这些标签,您还需要选择正确的 Eclipse 透视图。我终于发现包含“任务”列表的“标记”选项卡仅在“Java EE”视角下可用......希望这有帮助! :-)
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! :-)
显然,有些发行版或自定义构建不具备为非 Java 文件设置任务标签的功能。 这篇文章提到ColdFusion Builder(基于Eclipse构建)不允许您设置非Java任务标签,但CF Builder 2的测试版可以。 (我知道OP没有使用CF Builder,但我是,而且我自己也想知道这个问题......因为他没有看到设置非Java标签的能力,我认为其他人可能也有同样的情况位置。)
There are apparently distributions or custom builds in which the ability to set Task Tags for non-Java files is not present. This post mentions 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.)