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

Add smart completion for ValueMapping

Open filiphr opened this issue 6 years ago • 3 comments

Smart completion for @ValueMapping annotation means that the suggested values are not used in the other @ValueMapping annotations for this method.

filiphr avatar Aug 20 '17 06:08 filiphr

This idea is now 5 years old, but still I would like to see that in mapstruct-idea. I agree that for @ValueMapping the source should only suggested values are not used in the other @ValueMapping. But for the targets this don't apply.

For example:

A -> B
B -> C

is a valid mapping, but also

A -> B
C -> B

is valid.

hduelme avatar Jun 21 '22 22:06 hduelme

@hduelme keep in mind that normal auto completion works.

and yes you are right repeating targets do apply. So this smart completion will mostly be for the source.

Do you by any chance want to work on this functionality?

filiphr avatar Jun 22 '22 07:06 filiphr

@filiphr I completely new to IntelliJ plugin development. But still I want to try. I already found the related source ComponentModelCompletionContributor. There is a hit whats missing: TODO If we can somehow get access to all the AnnotationBasedComponentModelProcessor and extract their getComponentModelIdentifier then we can use those. I don't know how to do this within the plugin

I think if we found a way to get them all we could also improve other parts for example duplicated source/target checks.

hduelme avatar Jun 22 '22 13:06 hduelme