Eclipse Outline View - filter to hide lombok set and get methods

524 views
Skip to first unread message

Frank

unread,
Feb 19, 2014, 6:58:31 AM2/19/14
to project...@googlegroups.com
I really like Lombok to get rid of the boilerplate setter and getter in JSF view bean projects. The source code is much more compacted and reduced to the exceptions.

What I miss is a possibility to filter out the setter/getter methods in the Eclipse Outline view. Lombok simulate the existance of get and set methods in outline as well, but this hinders me to find the "interesting" methods only. I filter in outline view would be perfect.

Does anybody know how to filter out the Lombok set/get methods from outline view?

djeang

unread,
Feb 19, 2014, 9:47:52 AM2/19/14
to project...@googlegroups.com
I think there's no way for Eclipse to know if a method has been generated by Lombok or not. May, what you need is only an Eclipse feature that allow to hide getter/setter methods on outline view, whenever methods come from Lombok or not.

Reinier Zwitserloot

unread,
Feb 20, 2014, 6:41:56 AM2/20/14
to project-lombok

Eclipse does not support the concept of generated methods, nor does it have a concept of hiding contents in the overview depending on properties.we could add it, but messing with gui aspects is not something we should get into until we repackage the eclipse support as a plugin.

Good idea though!

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Peter Mucha

unread,
Mar 6, 2014, 11:12:03 AM3/6/14
to project...@googlegroups.com
I actually dont think, that this is a good idea. 
first of all, lombok then becomes "more magical" and secondly, i use the generates setters/getters in the outline to "find usages" which i cannot do anymore on the method directly.
but for a start, you could use the filters on the outline, e.g. naming filter, but this maybe filters out too much.

as for lombok implementation, there is an interessting post here: http://winterbe.com/posts/2009/10/05/customize-the-eclipse-outline/   maybe add @Category too generated stuff.
probably, this can be used for filtering..

Reinier Zwitserloot

unread,
Mar 6, 2014, 9:04:58 PM3/6/14
to project...@googlegroups.com
You can run 'find usages' on the annotation. This counts for all lombok features; for example, if you use 'find usages' on a @Data or @Value annotation, it'll find constructor calls (we had to choose one of the many things that are generated as the one that is found for this sort of operation; the constructor seemed like the most logical thing). Same goes for @EqualsAndHashCode (I believe we decided that equals wins that fight), @ToString, etc.

synthetic is a property of methods generated by the compiler to plaster over leaky abstractions between the language model and the bytecode model. synthetic methods and fields are completely ignored by javac; any attempt to call them or refer to them act as if the method doesn't exist. The only way to call a synthetic method is to use reflection, or to handcraft bytecode to do it. We can't use synthetic for this reason.

This @category stuff is fascinating. I don't think we can ever meaningfully use this (we'd have to generate javadoc, and categories are for more than just eclipse outline views, so just blithely assigning @category generated everywhere is going to have unintended side effects), but at least if eclipse has this feature we might be able to patch it to think that lombok-generated stuff has a 'lombok' or 'generated' or whatnot category.

For future reference, I filed an issue for this: https://code.google.com/p/projectlombok/issues/detail?id=650
Reply all
Reply to author
Forward
0 new messages