Custom code coverage line

Hi. Is it possible to create custom code coverage line from plugin?

Painted prototype. I imagine something like this:

1. the existing code coverage line

2. I want to create this line from my plugin.

Is it possible? If yes, how can i create this line from plugin?

Thanks.

1 comment

Hi,

AFAIK plugin can't reserve space in a gutter. So, custom line will have to conflict with some other area of the gutter (just like coverage line did in previous versions - by painting behind line numbers http://i.stack.imgur.com/Gz2DJ.pngIDEA-144638).

To show your own line, you can create RangeHighlighter and set LineMarkerRenderer on it. It can implement ActiveGutterRenderer to handle mouse clicks. Note, that you can draw outside of the area of passed Rectangle.

By default, it paints in a VCS-changed-lines area. It can override LineMarkerRendererEx.getPosition() to be painted in a code coverage area.

As an alternative, you can use API, that is used by VCS annotations (git blame) - EditorGutter.registerTextAnnotation and EditorGutter.closeAllAnnotations. But they will conflict with vcs annotations.

1

Please sign in to leave a comment.