Bug 538262 - [code mining] Headline annotations has painting problems when combined with highlight annotation
Summary: [code mining] Headline annotations has painting problems when combined with h...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.9   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.10 RC2   Edit
Assignee: Angelo ZERR CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 531769
Blocks:
  Show dependency tree
 
Reported: 2018-08-24 18:25 EDT by Alex Boyko CLA
Modified: 2018-12-06 13:08 EST (History)
6 users (show)

See Also:


Attachments
Screenshot of the painting issue (127.97 KB, image/png)
2018-08-24 18:25 EDT, Alex Boyko CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Boyko CLA 2018-08-24 18:25:12 EDT
Created attachment 275532 [details]
Screenshot of the painting issue

I have Code Mining annotations in my editor. You can consider them to be the same as in LSP4E.
Also, I have standard highlight annotations defined with org.eclipse.ui.editors.markerAnnotationSepcification extension point.
Here is the XML for the marker spec:

   <extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
      <specification
            annotationType="org.springframework.tooling.bootinfo"
            colorPreferenceKey="STS4BootMarkerIndicationColor"
            colorPreferenceValue="219,236,207"
            contributesToHeader="false"
            highlightPreferenceKey="STS4BootMarkerHighlighting"
            highlightPreferenceValue="true"
            label="Boot Dynamic Info"
            overviewRulerPreferenceKey="STS4BootMarkerIndicationInOverviewRuler"
            overviewRulerPreferenceValue="true"
            presentationLayer="4"
            showInNextPrevDropdownToolbarAction="false"
            textPreferenceKey="STS4BootMarkerIndication"
            textPreferenceValue="true"
            textStylePreferenceKey="STS4BootMarkerTextStyle"
            verticalRulerPreferenceKey="STS4BootMarkerIndicationInVerticalRuler"
            verticalRulerPreferenceValue="true">
      </specification>
   </extension>

Now when i have both of these annotations for the same range at the beginning of the line skipping white space I get painting issue shown on the screenshot
Comment 1 Angelo ZERR CLA 2018-08-25 07:25:22 EDT
I have not tested this usecase, but I think the problem is that codemining header annotation set a GlyphMetrics with a given offset for the given range. Setting GlyphMetrics in a given offset replace the character and line header annotation drawing strategy fixes the problem by redrawing the character.

I think your problem is the same than standard usecase and it misses teh character. I think https://bugs.eclipse.org/bugs/show_bug.cgi?id=531769 should fix your problem but it requires to change TextLayout for each OS. I have started to do that for Windows OS, but it's an hard task, and I have not found other guys which could update TextLayout for other OS. Any help, contribution are welcome!
Comment 2 Alexander Fedorov CLA 2018-11-10 05:45:04 EST
I have similar problem with Target Definition source editor (Bug 534758)

For the content like 
"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="some.target">
</target>
"

LineHeaderCodeMining with beforeLineNumber<2 disappers after change in editor
Debugging shows that it goes more or less good till the CodeMiningLineContentAnnotation.redraw call
Comment 3 Angelo ZERR CLA 2018-11-10 08:18:24 EST
Perhaps https://bugs.eclipse.org/bugs/show_bug.cgi?id=539624 could fix this problem?
Comment 4 Angelo ZERR CLA 2018-11-23 12:17:45 EST
@Alex, @Alexander, is https://bugs.eclipse.org/bugs/show_bug.cgi?id=539624 fixes this bug?
Comment 5 Alex Boyko CLA 2018-11-23 15:16:30 EST
Is there a specific version of Eclipse i can target to test it out?
Comment 6 Mickael Istria CLA 2018-11-23 15:38:41 EST
(In reply to Alex Boyko from comment #5)
> Is there a specific version of Eclipse i can target to test it out?

4.10.M3 should be ok to test this: http://download.eclipse.org/eclipse/downloads/drops4/S-4.10M3-201811211800/
Or the latest I-Build
Comment 7 Mickael Istria CLA 2018-12-06 13:08:21 EST
I'm closing this one as it seems like there are no remaining issues.
Feel free to reopen and retarget if it's still there.