Test line extensions generated by EditorLinePainter


Is it possible to test line extensions generated using EditorLinePainter? I didnt find any information about it.

I didnt find any useful function for that in:


Thank you for your help




Hi Tomas,

Sorry, it's not clear what are you trying to do, can you please specify? Are you working on custom plugin?



i am sorry. I am developing plugin, where i paint additional text at the end of some lines (line extensions). For this, i am using EditorLinePainter.class and i am overriding getLineExtensions method to paint a text.

And i would like to write unittest for this functionality, to check if the text was painted at specified line.

I would expect testHighlighting() from  CodeInsightTestFixture.class would run my plugin code and paint the text or something similar. But it doesnt work and i didnt find any function to do that. 

How can i test EditorLinePainter?




Hello Tomas,

If possible please describe in more details what are you planning to test. Thank you


Hi Olga,

of course. So firsly i will describe functionality of my plugin. As i said i have a class which extend from:

In this class i override method getLineExtensions(). Inside the method, i create instances of the object:
I return collection of these instances.

This way i am able to paint custom text at different lines to different files in editor. Example:

The red text (its not clickable and cannot be edited, its just painted there) is result. And i want to unit test this.



Hello Tomas, Sorry for a long time to reply. Unfortunately, IntelliJ Platform does not provide a way to unit test Line Extensions. They are rendered as graphical elements, not the text, and you may test them using some image comparison tool.

Please sign in to leave a comment.