In Eclipse, most of the coverage plugins, display covered/partially covered/uncovered lines with different colors (i.e. the whole line painted with a color)
In IntelliJ Idea, I couldn't find a way yet to paint the whole line with a descriptive color, only a small, almost imperceptible mark is added on the left hand side, making the visualization of partially covered / uncovered lines really difficult.
Any idea?
Coverage in the Coverage tool window If you want to reopen the Coverage tool window, select Run | Show Code Coverage Data from the main menu, or press Ctrl+Alt+F6 . The report shows the percentage of the code that has been executed or covered by tests. You can see the coverage result for classes, methods, and lines.
To enable code coverage highlighting In the IDEA IDE, on the Analyze menu, click Show Code Coverage Data, or use the Ctrl+Alt+F6 keyboard shortcut.
When you open a source file you can also see what lines are fully covered, partially covered, or not covered at all. You might want to customize the Colors & Fonts through File -> Settings -> Editor -> Colors & Fonts -> General modifying the following entries: Full line coverage. Partial line coverage.
I found the solution to this problem here but I thought it would be better to create a specific, well-phrased question so that people having exactly the same problem as me can find it better in Google / StackOverflow.
In a nutshell, through Editor -> Colors & Fonts -> General
(or, at least from IntelliJ 2017.3 onwards, Editor -> Colors Scheme -> General
)
you can customize the Colors & Fonts used for covered/partially covered/uncovered lines, modifying the background of the following entries:
For example, I wanted to use the same default colors already provided but not only on the margin but on the whole line (similar to how Eclipse does it), so I disabled "Foreground" and enabled "Background". Voilà!
I think the UI has been updated the the way to get to this option has changed. While it is already mentioned by others, I'd like to elaborate with a more detailed image to make it easier to see.
Intellij > Preferences > Editor > Color Scheme > General > Line Coverage >
There you will have three options.
Here is the menu option:
And here is what the question is specifically looking for:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With