mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Support for MapStruct SPI

Open coney opened this issue 3 years ago • 10 comments

My DTOs are auto generated. each field is generated with an setter(setXXX) and chained accessor(withXXX). I wrote a customized AccessorNamingStrategy SPI to exclude those methods start with with and added the SPI to my project's preprocessor.

My SPI has successfully enlimited warnings of withXXX accessors. but in my IDEA, it still promotes the hits for adding withXXX mappings: image

coney avatar Feb 14 '22 07:02 coney

Having same issue when trying to use the protobuf SPI

91wzhang avatar Jul 12 '22 00:07 91wzhang

@coney This ia a tricky one to be honest. There is no way for us to invoke the SPI from within the plugin. What we could offer perhaps is a way for people to somehow configure how certain methods need to be ignored.

@91wzhang supporting the protobuf SPI is perhaps that we need to look into independently. I would suggest creating a separate issue for that

filiphr avatar Jul 14 '22 19:07 filiphr

@coney This ia a tricky one to be honest. There is no way for us to invoke the SPI from within the plugin. What we could offer perhaps is a way for people to somehow configure how certain methods need to be ignored.

@91wzhang supporting the protobuf SPI is perhaps that we need to look into independently. I would suggest creating a separate issue for that

Great, maybe a simple configurable regex pattern is enough for my scenario

coney avatar Jul 30 '22 07:07 coney

Great, maybe a simple configurable regex pattern is enough for my scenario

That is an interesting idea @coney. We can look into that one.

filiphr avatar Aug 01 '22 17:08 filiphr

@coney would you be interested in providing this functionality to the plugin?

filiphr avatar Aug 01 '22 17:08 filiphr

@filiphr : I gave it a first try - see https://github.com/mapstruct/mapstruct-idea/pull/150

jomu78 avatar Aug 25 '23 22:08 jomu78

Thanks @jomu78. I've added a response on the PR in https://github.com/mapstruct/mapstruct-idea/pull/150#issuecomment-1712785314

filiphr avatar Sep 10 '23 11:09 filiphr