Bug 571692 - Code minings are conflicting with annotation highlighting
Summary: Code minings are conflicting with annotation highlighting
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.18   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-04 09:18 EST by Julien HENRY CLA
Modified: 2021-03-04 09:19 EST (History)
0 users

See Also:


Attachments
Screenshot of a minimal reproducer in action (33.88 KB, image/png)
2021-03-04 09:18 EST, Julien HENRY CLA
no flags Details
Screenshot of the issue in SonarLint real life situation (75.73 KB, image/png)
2021-03-04 09:19 EST, Julien HENRY CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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