Bug 532130 - [code mining] Draw line header annotation with GlyphMetrics ascent
Summary: [code mining] Draw line header annotation with GlyphMetrics ascent
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.8 M7   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on: 530019 532173
Blocks: 529997
  Show dependency tree
 
Reported: 2018-03-07 11:58 EST by Angelo ZERR CLA
Modified: 2018-04-05 17:31 EDT (History)
3 users (show)

See Also:
Lars.Vogel: pmc_approved+
daniel_megert: pmc_approved+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Angelo ZERR CLA 2018-03-07 11:58:31 EST
Inlined line header annotation are drawn in the previous line spacing  of the line. This line spacing is managed with the StyledTextLineSpacingProvider which works well but must require some improve.

An another idea is to manage line header annotation like line content annotation with GlyphMetrics ascent. It will require to fix other problem like cursor line height, etc
Comment 1 Mickael Istria CLA 2018-03-07 12:05:06 EST
(In reply to Angelo ZERR from comment #0)
> Inlined line header annotation are drawn in the previous line spacing  of
> the line. This line spacing is managed with the
> StyledTextLineSpacingProvider which works well but must require some improve.

I also think that using LineSpacingProvider for this now seems semantically incorrect: the linespacingprovider create line space between the lines when they are wrapped or don't apply on 1st line. This is the good behaviour for line spacing in general (think about what LibreOffice does for which the linespacingprovider would be perfect) but really isn't suitable for lineheaders as codeminings use it.

> An another idea is to manage line header annotation like line content
> annotation with GlyphMetrics ascent.

That's much more consistent and would greatly simplify code and reduce the number of entangled issues to consider for better codeminings. It's IMO a very good way forward (which could be made perfect with bug 531769).

> It will require to fix other problem like cursor line height, etc

If those problems are existing problems that surface now, then I think it's a good thing as it's a fight against technical debt. Please make sure you open different tickets for those.
Comment 2 Eclipse Genie CLA 2018-03-07 12:08:27 EST
New Gerrit change created: https://git.eclipse.org/r/118919
Comment 3 Angelo ZERR CLA 2018-03-07 12:10:05 EST
Here a gerrit patch with this idea  https://git.eclipse.org/r/118919 but please note it's not perfect.

There are severl problem with cusror, matching bracket and clipping. I will create bugs for each problem.
Comment 4 Eclipse Genie CLA 2018-03-12 21:08:15 EDT
New Gerrit change created: https://git.eclipse.org/r/119283
Comment 6 Dani Megert CLA 2018-03-19 05:39:09 EDT
(In reply to Eclipse Genie from comment #5)
> Gerrit change https://git.eclipse.org/r/119283 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=2d294da598154bcd7ebf63fa4dc6ae8783304be5
> 

This has unapproved API changes after the freeze:
http://download.eclipse.org/eclipse/downloads/drops4/I20180318-2000/apitools/freeze_report.html

Either revert or request PMC approval for that.
Comment 7 Mickael Istria CLA 2018-03-19 05:50:00 EDT
Thanks Dani. I missed this one as the getLineSpacing method was somehow internal design. The initial issue is that we missed to add the @noreference tag.
I'll ask PMC approval for this to be changed.
Comment 8 Lars Vogel CLA 2018-03-19 06:27:10 EDT
+1 from a PMC member, please give other PMC members are chance to cast their vote.
Comment 9 Dani Megert CLA 2018-03-19 10:30:24 EDT
(In reply to Lars Vogel from comment #8)
> +1 from a PMC member, please give other PMC members are chance to cast their
> vote.

You're good to go.
Comment 10 Mickael Istria CLA 2018-03-19 10:36:47 EDT
(In reply to Dani Megert from comment #9)
> (In reply to Lars Vogel from comment #8)
> > +1 from a PMC member, please give other PMC members are chance to cast their
> > vote.
> 
> You're good to go.

Thanks guys and sorry for the disturbance!
Comment 11 Angelo ZERR CLA 2018-03-19 11:41:20 EDT
Sorry guys with my big mistake to expose getLineSpacing in the InlinedAnnotationSupport.

No I understand more why Eclipse code defines internal listener and not implement the root class with listener interface. 

Thank's again to Eclipse code for teaching me something else!
Comment 12 Lars Vogel CLA 2018-03-19 11:47:13 EDT
(In reply to Angelo ZERR from comment #11)
> Sorry guys with my big mistake to expose getLineSpacing in the
> InlinedAnnotationSupport.
> 
> No I understand more why Eclipse code defines internal listener and not
> implement the root class with listener interface. 
> 
> Thank's again to Eclipse code for teaching me something else!

No worries master Angelo. If I could make such cool mistakes as you I would be very proud