mapstruct / mapstruct-idea

An IntelliJ IDEA plugin for working with MapStruct
Other
141 stars 38 forks source link

Rework `@InheritConfiguration` and support auto-inheritance #151

Closed thunderhook closed 1 year ago

thunderhook commented 1 year ago

Followup of #65.

First: there is a wrong implementation because the plugin supports inheritance over referenced mappers (uses=...), which is not supported, see CarMapperWithExplicitInheritance in the mapstruct project.

Second: the MappingInheritanceStrategy.AUTO_INHERIT_* options of @MapperConfig are not supported yet. Therefore you see warnings/errors that are simply wrong.

So I rewrote the whole inheritance logic and followed the code that implemented it in the mapstruct main project. I copied some of the code to be consistent with the original mapstruct code. I also commented where to find the logic in the mapstruct project (for the case they get a proper refactoring...)