清除 Eclipse 中突出显示的覆盖范围

发布于 2024-11-09 07:18:07 字数 111 浏览 4 评论 0原文

在 Eclipse 中运行覆盖率报告(使用 cobertura 或 EMMA 插件)后,我的源代码文件会以绿色、红色和黄色突出显示,具体取决于测试覆盖了哪些代码行。

完成后如何清除该突出显示?

After running coverage reports in Eclipse (using cobertura or an EMMA plugin), my source code files get highlighted in green, red and yellow depending on which lines of code were covered by tests.

How can I clear this highlighting after I'm done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

司马昭之心 2024-11-16 07:18:07

单击“覆盖范围”视图工具栏中的“删除所有会话”按钮。

在此处输入图像描述

Click the "Remove all Sessions" button in the toolbar of the "Coverage" view.

enter image description here

眼眸里的那抹悲凉 2024-11-16 07:18:07

在 4.2 eclipse 上,似乎不可能删除 eCobertura 亮点。遗憾的是 eCobertura 插件似乎不再维护了。然而,如果你开始在课堂上写作,它就消失了。所以输入一个空格,然后撤消,它就消失了。

On 4.2 eclipse it seems to be impossible to remove the eCobertura highlights. Sadly eCobertura plugins seems to be not maintained anymore. However if you start writing into the class, its gone. So type a space, and then undo, and its gone.

谜泪 2024-11-16 07:18:07

对于无法找到覆盖范围视图的用户,请按照以下步骤操作:

转到 Windows 菜单栏 >显示视图>其他>输入coverage并打开它。

输入图像描述此处

单击覆盖范围。

要清除突出显示,请根据方便单击X 或XX 图标。

输入图像描述这里

For people who are not able to find the coverage view , follow these steps :

Go to Windows Menu bar > Show View > Other > Type coverage and open it.

enter image description here

Click on Coverage.

To clear highlightings, click on X or XX icon as per convenience.

enter image description here

听,心雨的声音 2024-11-16 07:18:07

我在 GitHub 上找到了解决方法:https://github.com/jmhofer/eCobertura/issues/8

不想点击链接的朋友可以看下面的评论:

好的解决方法:
使用过滤器创建一个运行配置,排除所有内容(“*”)并让它仅运行一个测试。将其命名为“撤消覆盖范围”。

我这样做了,并且在 Eclipse Juno 中运行得很好。

这要归功于 UsulSK。

I found a workaround over on GitHub: https://github.com/jmhofer/eCobertura/issues/8

For those who don't want to click the link, here's the text of the comment:

Good workaround:
Create a run configuration with a filter, that excludes everything ("*") and let it run just a single test. Name it "Undo coverage".

I did this and it worked quite well in Eclipse Juno.

Credit for this goes to UsulSK.

泪冰清 2024-11-16 07:18:07

如果删除覆盖会话,覆盖颜色也会消失。为此,请点击“覆盖范围”视图工具栏中的“删除会话”或“删除所有会话”。

http://eclemma.org/faq.html

If you remove the coverage session, also the coverage coloring will disappear. For this, hit Remove Session or Remove All Sessions in the Coverage view's toolbar.

http://eclemma.org/faq.html

世界等同你 2024-11-16 07:18:07

对于那些像我一样使用 Cobertura 并且只有 Coverage Session View 的人,只需尝试关闭 Eclipse 并再次启动它即可。这对我来说不再突出显示。

For those using Cobertura and only have the Coverage Session View like I do,just try closing Eclipse and starting it up again. This got rid of the highlighting for me.

淡水深流 2024-11-16 07:18:07

当“编辑 Java 源代码”以“删除活动会话”时,向键绑定添加了快捷键 Ctrl+Shift+XC(窗口 -> 首选项 -> 键过滤器)。

Added shortcut Ctrl+Shift+X C to Keybindings (Window -> Preferences -> filter for Keys) when 'Editing Java Source' for 'Remove Active Session'.

终难愈 2024-11-16 07:18:07

如果您想删除活动会话/项目/文件夹,则可以单击

“覆盖范围”视图工具栏中的“删除活动会话”按钮。

If you would like to remove active session/project/folder then you can follow

Click the "Remove Active Session" button in the toolbar of the "Coverage" view.

少跟Wǒ拽 2024-11-16 07:18:07

我使用了Open Clover工具来进行代码覆盖率,我也找了很长时间。
它非常简单,在“覆盖率浏览器”选项卡中,您可以找到三个方形按钮,其中表示您要显示的代码行,单击“隐藏覆盖率”方框即可消失。下图中最后一个按钮:
输入图片此处描述

I have used the Open Clover Tool for the code coverage, I have also been searching this for a long time.
Its pretty straightforward, in the Coverage Explorer tab, you can find three square buttons which says the code lines you wanted to display, click on hide the coverage square box and its gone. Last button in the image below:
enter image description here

め可乐爱微笑 2024-11-16 07:18:07

关闭 IDE 并再次打开。如果您没有使用任何代码覆盖率工具并且只是单击 IDE 中的基本“覆盖率”图标,则此方法有效。

Close the IDE and open it again. This works if you did not use any code coverage tools and have just clicked the basic "Coverage" icon in the IDE.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文