Bug 571692

Summary: Code minings are conflicting with annotation highlighting
Product: [Eclipse Project] Platform Reporter: Julien HENRY <julien.henry>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.18   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Screenshot of a minimal reproducer in action
none
Screenshot of the issue in SonarLint real life situation none

Description Julien HENRY CLA 2021-03-04 09:18:23 EST
Created attachment 285732 [details]
Screenshot of a minimal reproducer in action

Hi,

In our plugin, we are creating markers. For those markers, in the editor, we add:
 - one LineContent code mining
 - one LineHeader code mining
 - one annotation (with type highlighting)

I found a nasty rendering issue in the situation when the annotation has to be "split" when painted in the editor. It results in an extra highlighting on the next line (see screenshot).

I discovered that is can even be reproduced with any annotation, like "toggle mark occurrences", so I guess the problem is not on our side, but more likely during the split of ranges.

I also noticed that I can only reproduce by using a combinaison of the 2 code minings. Using "line header" alone or "line content" alone would not produce the issue.

I have started investigating the issue, and I am currently lost in org.eclipse.jface.text.source.AnnotationPainter and org.eclipse.jface.text.TextPresentation#applyStyleRange

Before going further, I would like to know:
- do you acknowledge this is a true issue?
- am I looking at the right place to fix the issue?
Comment 1 Julien HENRY CLA 2021-03-04 09:19:21 EST
Created attachment 285733 [details]
Screenshot of the issue in SonarLint real life situation