Closed agudian closed 9 years ago
Rebased to master and fixed a checkstyle issue... :)
@agudian: wrt. "@TargetType parameters and support enum constants": How does this look exactly? I can't seem to trigger that functionality in manual tests.
Which makes me think that we should document the list of supported quick fixes and auto-completions in some help document (not at least for the reason that we don't have any tests, so to at least keep track of the functionality we expect to work).
@agudian: wrt. "@TargetType parameters and support enum constants": How does this look exactly? I can't seem to trigger that functionality in manual tests.
The proposals didn't work on enum-mapping methods or on methods that had @TargetType
or @MappingTarget
parameters. They should now, including giving proposals for enum instances.
The missing tests are really starting out to be annoying... we need to do something there... :smirk:
I can confirm it works with @MappingTarget
. But what should it do for @TargetType
? That's used on manually implemented methods, right? So I am not sure what a completion would look like?
For some reason it doesn't suggest enum constants as source() or target(). Not sure why...
But what should it do for @TargetType?
Ehm.. right... strange... don't know what I was thinking...
For some reason it doesn't suggest enum constants as source() or target(). Not sure why...
Just tried it again - it works for me... The caret needs to be within the "
... Damn we need some tests...
Just tried it again - it works for me...
Could you share your enum and mapper type definitions you use for testing?
Could you share your enum and mapper type definitions you use for testing?
I tried with a mapper from my day-work project, with enums and mapper in different eclipse projects.
But I also tried it with this one, and the completions a
and b
were provided by the plugin:
@Mapper
public interface SourceTargetMapper {
@Mapping(target = "a", source = "b")
B toB(A a);
public enum A {
a, b;
}
public enum B {
a, c;
}
}
Merged and added one more commit to change the method return types. Thanks, @agudian! Re-tested it and it also works with enum types now. Not sure why it didn't last time I tried.
Property name completion: handle multiple sources, handle @MappingTarget/@TargetType parameters, support enum constants
I've put the commit ontop of PR #18- mainly so I could use the MapStructAPIConstants class that I introduced there... hope it's ok... :wink: