Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smart completion for ValueMapping #5

Closed
filiphr opened this issue Aug 20, 2017 · 3 comments
Closed

Add smart completion for ValueMapping #5

filiphr opened this issue Aug 20, 2017 · 3 comments
Milestone

Comments

@filiphr
Copy link
Member

filiphr commented Aug 20, 2017

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

@hduelme
Copy link
Contributor

hduelme commented Jun 21, 2022

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.

@filiphr
Copy link
Member Author

filiphr commented Jun 22, 2022

@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?

@hduelme
Copy link
Contributor

hduelme commented Jun 22, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants