Skip to content

add unknown reference inspection #213

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

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

hduelme
Copy link
Contributor

@hduelme hduelme commented Dec 22, 2024

I added an inspection which reports all unknown mapstruct references as unknown symbol errors. This also works for references with dot notation.
My implemtation is based on https://github.com/JetBrains/intellij-community/blob/master/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesInspection.java.

I added tests for all mapstruct references:

  • source in @Mapping annotation
  • target in @Mapping annotation
  • source in @ValueMapping annotation
  • target in @ValueMapping annotation
  • qualifiedByName in @Mapping annotation

For nested targets the inspection looks like
grafik

fixes #178

@hduelme
Copy link
Contributor Author

hduelme commented Dec 22, 2024

This should fix #178

@filiphr filiphr merged commit cf8d6b6 into mapstruct:main Jan 18, 2025
6 checks passed
@filiphr
Copy link
Member

filiphr commented Jan 18, 2025

Nice work on this @hduelme

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

Successfully merging this pull request may close these issues.

Report Non-existing target properties as errors
2 participants