Closed sradi closed 9 years ago
Thanks a lot, @sradi! I'll have a look at it asap.
The list of supported component models is currently a fix list. Does anybody have a suggestion to improve this? Perhaps, if the supported values were implemented as an enum in mapstruct, I could read the supported values with reflection.
I think it's ok as is. It is intentionally not an enum in MapStruct, in order to allow for the addition of custom component models down the road. Admittedly, that'd require some more changes (such as making the templates somehow user-customizable), but that was the motivation behind it.
Hi @sradi, looks good to overall, just added some minor, mostly style-related comments. Thanks a lot for your first contribution to the plug-in!
Btw. do you think you could rework this commit and split it up into two: one for the refactoring and one for the new feature? Generally, smaller, dedicated commits are easier to grasp. Thanks again!
@sradi I took another look and I came to wonder why there is MapStructCompletionProposalComputer
and the hierarchy of AbstractAnnotationCompletionProposalComputer
s? Wouldn't it make more sense to just have one base class, the two implementations for @Mapper
and @Mapping
and register these two implementations as extensions in plugin.xml
?
If you like the idea, just rework the concerned commits, otherwise I can do it as well. WDYT?
@gunnarmorling oh, sure. I will change this.
@sradi Will you send a new pull request then? You also can re-open this one and (force-) push further commits to this branch. Whatever you like better :)
I implemented auto-completion for
@Mapper#componentModel
. For this addition, I refactored the code to have separate proposal computer classes for each annotation. @larswetzer: What do you think about this change? Any hints to improve the code are welcome.The list of supported component models is currently a fix list. Does anybody have a suggestion to improve this? Perhaps, if the supported values were implemented as an enum in mapstruct, I could read the supported values with reflection.