Community
Participate
Working Groups
Created attachment 271608 [details] Inline annotations demo To support CodeMining https://bugs.eclipse.org/bugs/show_bug.cgi?id=527515, we need to provide a support to draw inline annotations: * draw inline annotation before a line. This kind of inline annotations can be drawn inside the line spacing (by consuming the new API StyledTextLineSpacingProvider). A sample is for CodeMining to draw references, implementations, etc before a Java class. * draw inline annotation inside an existing line. This kind of inline annotations can use GlyphMetrics to take some width place. A sample for CSS color where you can draw a colorized square before the rgb declaration. You can see those inline annotations in the attached demo.
New Gerrit change created: https://git.eclipse.org/r/112192
@Mickael thanks for your review. Please note some limitations with my gerrit patch: * you cannot draw "block" annotation for the first line. * not tested when there is apply TextPresentation, I think there will have some trouble since I set the stylerange for GlyphMetrics (I don't merge it). * Font changed (like zoom) is not supported, so I think there will have some trouble inside Eclipse IDE when we will use Zoom I hope those limitations will not block the contribution. I think we could improve this gerrit patch after.
I agree those limitations aren't blockers. Let's try to get the patch merged first in a decent state. In worst case, if we feel the quality isn't there yet for Photon, we'll put the classes in an internal package to leave room for improvement while not blocking early adopters.
@Mickael, I have continued in my side to develop CodeMining with this inline annotation support and I have tested inside Eclipse IDE (with Generic Editor) and it works very well. CodeMining is based on LineHeaderAnnotation. However I have tested LineContentAnnotation (with GlyphMetrics) and there is some limitation like when we do a Zoom. I think we can improve too the width compute by caching it (when annotation doesn't change the text). In otherwise LineHeaderAnnotation works great but LineContentAnnotation have some limitation/improvement to do. I tell me if you wish I try to fix it in this gerrit patch (1) or a new gerrit patch (2) (I will prefer that to speed the contribution)? > I agree those limitations aren't blockers. It seems that you are OK with (2), but I prefer tell you that it will need perhaps a litte changed with GlyphMetrics. Tell me what you wish.
@Angelo: at this point, the code is in a good enough state and the issue you mention are not design issue that would cascade to huge refactoring, but more internal bug fixes. We can treat them as different bugs/patches later.
@Mickael thanks for your answer.I wanted just to say you those limitation, and I'm glad that we will able to fix in another gerrit patch, that's cool:)
Guys do you think when you will able to review my gerrit patch? I would like to continue to contribute with other gerrit patch for CodeMining. I'm waiting for the accept of this gerrit patch. Any feedback are welcome, thanks!
Gerrit change https://git.eclipse.org/r/112192 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=3b60a74ba0cdddbfac2322cd6743d790d16af3f9
Thanks @Mickael to have merged inlined support! Now how can we do for JFace text examples? Is it possible for you to create an empty project and after I could add my demo with inlined annotations? I need this project too for CodeMining (I have a demo too for that).
Sure, if no existing example project is a good host for your example, feel free to creatw a new one. I'd be glad to help you by providing the poms in another commit.
New Gerrit change created: https://git.eclipse.org/r/112611
@Mickael please see https://git.eclipse.org/r/112611 which adds the inlined annotation demo.
Gerrit change https://git.eclipse.org/r/112611 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=6efda0be081b3104a744e8fb2f3bebef64d922d2
Thanks @Mickael!
New Gerrit change created: https://git.eclipse.org/r/112635
New Gerrit change created: https://git.eclipse.org/r/112637
Gerrit change https://git.eclipse.org/r/112637 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=1a226fbce19dd05b21b2fd1127a80101d93a522a
(In reply to Eclipse Genie from comment #13) > Gerrit change https://git.eclipse.org/r/112611 was merged to [master]. This causes API version errors at two locations: Invalid @since tag '3.13.0' on org.eclipse.jface.text.source.inlined.Positions; expecting two fragments. Fixed with comment #17.
Gerrit change https://git.eclipse.org/r/112635 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=12696e3bfaaeb2bd17e1e79361d009b3906d9946
I get API Tools errors with the committed changes PLEASE(!!!) make sure set up your environment with the correct API baseline. This is especially required by committers. Please fix or revert.
New Gerrit change created: https://git.eclipse.org/r/112645
(In reply to Dani Megert from comment #20) > I get API Tools errors with the committed changes PLEASE(!!!) make sure set > up your environment with the correct API baseline. This is especially > required by committers. Please fix or revert. API tools initially showed only two errors which I fixed in comment #18. A re-build now showed 3 more errors (fixed in comment #21). Angelo, please set your API baseline to the latest available M-build for 4.7.2 and check if any other issues are missed.
Gerrit change https://git.eclipse.org/r/112645 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=e620510b6f138b5e01844607692b73e5c9c7f84a
New Gerrit change created: https://git.eclipse.org/r/112648
Gerrit change https://git.eclipse.org/r/112648 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=53bb42745d60d5d2d9b4fb7327962eb1fdf9b093
@Angelo: can you please provide a note with a screnshot of the example in the N&N?
New Gerrit change created: https://git.eclipse.org/r/112726
@Mickael, please see my N&N at https://git.eclipse.org/r/#/c/112726/ Hope it will be OK.
Gerrit change https://git.eclipse.org/r/112726 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=3d40a62f4b08c4379ce9eee591b3b96acd9f6f62
Thanks and congrats to Angelo for this important patch that enables a new era of UXin the IDE!