mapstruct-idea
mapstruct-idea copied to clipboard
MapStruct Support 1.3.1 Completion of target and source properties in @Mapping can not work
idea version 2020.1.3 ,mapstruct verison 1.5.2.Final MapStruct Support 1.3.1
Can you please be a bit more specific about what isn't working? The MapStruct version shouldn't affect the completion.
Can you please share an example of your mapper and source / target classes so we can look into it?
Can you please be a bit more specific about what isn't working? The MapStruct version shouldn't affect the completion.
Can you please share an example of your mapper and source / target classes so we can look into it?
ok,the classes as below
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompareA {
private String name;
private Integer age;
private LocalDateTime createTime;
private double score;
private Double totalScore;
private Date updateTIme;
private ChildCompare childCompare;
private Long days;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompareB {
private String name;
private Integer age;
private String createTime;
private double score;
private Double totalScore;
private Date updateTIme;
private ChildCompare childCompare;
private Long day;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ChildCompare {
private String childName;
private long childAge;
}
@Mapper
public interface CompareConvert {
CompareConvert INSTANCE = Mappers.getMapper(CompareConvert.class);
@Mappings({
@Mapping(source = "days",target = "day"),
@Mapping(source = "createTime",target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
@Mapping(source = "childCompare",target = "childCompare", mappingControl = DeepClone.class)
})
CompareB convert(CompareA compareA);
}
I think the problem relates to your usage of Lombok. Currently Lombok is not completely supported in this plugin.
I think the problem relates to your usage of Lombok. Currently Lombok is not completely supported in this plugin.
yes,I user lombok.the version of lombok is 1.18.22
I think the problem relates to your usage of Lombok. Currently Lombok is not completely supported in this plugin.
I remove lombok,but MapStruct Support 1.3.1 Completion of target and source properties in @Mapping can not work,i think the problem relates to idea version
Is there any possible solution to this? I'm having the same issue. I tried on both IDEA 2022.1 and 2021.3 with Mapstruct 1.5.3.Final and Lombok 1.18.24. When I Ctrl+left click on the annotation it goes to the declaration properly, but the completion candidates never show up. I've also tried delombok the classes and it does not make difference.
@dealexce @daitianci the MapStruct version that you are using doesn't make a difference. Are you sure that you have the IntelliJ MapStruct Plugin installed?
Closing this, since I cannot reproduce it