| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…s, and inspections Add support for the `@Ignored` annotation introduced in MapStruct 1.7. This includes: - Code completion for `@Ignored(targets=...)` with `prefix` support - Go-to-declaration and find usages for ignored target properties - UnmappedTargetPropertiesInspection considers `@Ignored` targets - TargetPropertyMappedMoreThanOnceInspection detects conflicts between `@Mapping` and `@Ignored` targeting the same property - Unknown target reference inspection for `@Ignored` targets Completion correctly excludes targets already defined in other `@Ignored` and `@Mapping` annotations on the same method, including prefix-scoped targets.
There was a problem hiding this comment.
Adds IntelliJ plugin support for MapStruct 1.7’s new @Ignored annotation, integrating it into completion, references, and inspections while refactoring shared target-reference logic.
Changes:
Copilot reviewed 38 out of 39 changed files in this pull request and generated 1 comment.
Show a summary per file| File | Description |
|---|---|
| testData/mapping/CarMapperReturnTargetCarDtoWithIgnored.java | New completion fixture covering @Ignored interaction with @Mapping. |
| testData/inspection/UnmappedTargetPropertiesWithIgnored.java | New inspection fixture verifying unmapped-target logic respects @Ignored (incl. prefix). |
| testData/inspection/UnknownIgnoredTargetReference.java | New reference-highlighting fixture for unknown @Ignored targets/prefix/nesting. |
| testData/inspection/TargetPropertyMappedMoreThanOnceWithIgnored.java | New fixture for detecting @Mapping/@Ignored and @Ignored/@Ignored conflicts. |
| testData/completion/ignored/IgnoredTargetsWithPrefixMultipleTargets.java | Completion fixture for prefix + multiple targets. |
| testData/completion/ignored/IgnoredTargetsWithPrefixAndMapping.java | Completion fixture ensuring @Mapping targets are excluded from @Ignored suggestions. |
| testData/completion/ignored/IgnoredTargetsWithPrefix.java | Completion fixture for prefix without pre-filled targets. |
| testData/completion/ignored/IgnoredTargetsWithMapping.java | Completion fixture ensuring @Ignored excludes @Mapping(ignore=true) targets. |
| testData/completion/ignored/IgnoredTargetsWithInvalidPrefix.java | Completion fixture expecting no suggestions when prefix is invalid. |
| testData/completion/ignored/IgnoredTargetsSingleNoArray.java | Completion fixture for targets = "..." (non-array form). |
| testData/completion/ignored/IgnoredTargetsReferenceUnknownTarget.java | Reference fixture verifying unresolved target references. |
| testData/completion/ignored/IgnoredTargetsReferenceTargetWithPrefix.java | Reference fixture verifying resolution with prefix. |
| testData/completion/ignored/IgnoredTargetsReferenceTarget.java | Reference fixture verifying direct target resolution. |
| testData/completion/ignored/IgnoredTargetsReferenceNestedTarget.java | Reference fixture verifying nested target resolution. |
| testData/completion/ignored/IgnoredTargetsNoPrefix.java | Baseline completion fixture for @Ignored without prefix. |
| testData/completion/ignored/IgnoredTargetsMultipleTargets.java | Completion fixture excluding already-listed targets in the same annotation. |
| testData/completion/ignored/IgnoredTargetsMultipleAnnotations.java | Completion fixture excluding targets across multiple @Ignored annotations. |
| src/test/java/org/mapstruct/intellij/inspection/UnmappedTargetPropertiesWithIgnoredInspectionTest.java | New automated test for unmapped-target inspection behavior with @Ignored. |
| src/test/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspectionTest.java | Adds a test entry point for the new @Ignored conflict fixture. |
| src/test/java/org/mapstruct/intellij/inspection/MapstructReferenceInspectionTest.java | Adds reference-inspection test coverage for unknown @Ignored targets. |
| src/test/java/org/mapstruct/intellij/completion/IgnoredTargetsCompletionTestCase.java | New completion + reference tests dedicated to @Ignored. |
| src/test/java/org/mapstruct/intellij/MapstructCompletionTestCase.java | Extends existing completion suite to account for @Ignored on mapping methods. |
| src/main/java/org/mapstruct/intellij/util/TargetUtils.java | Adds utilities for collecting ignored targets (incl. @IgnoredList + prefix). |
| src/main/java/org/mapstruct/intellij/util/MapstructUtil.java | Adds FQNs for @Ignored/@IgnoredList and detects MapStruct 1.7 via class presence. |
| src/main/java/org/mapstruct/intellij/util/MapstructKotlinElementUtils.java | Adds Kotlin PSI element pattern for @Ignored parameters. |
| src/main/java/org/mapstruct/intellij/util/MapstructElementUtils.java | Adds Java PSI element pattern for @Ignored parameters. |
| src/main/java/org/mapstruct/intellij/util/MapstructAnnotationUtils.java | Generalizes repeatable-annotation extraction for reuse beyond @Mappings. |
| src/main/java/org/mapstruct/intellij/util/MapStructVersion.java | Adds V1_7_O version constant. |
| src/main/java/org/mapstruct/intellij/inspection/UnmappedTargetPropertiesInspection.java | Removes @Ignored targets from unmapped-target warnings. |
| src/main/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspection.java | Treats @Ignored targets as mapping targets for conflict detection. |
| src/main/java/org/mapstruct/intellij/codeinsight/references/MapstructTargetReference.java | Refactors target reference to reuse shared logic from BaseTargetReference. |
| src/main/java/org/mapstruct/intellij/codeinsight/references/MapstructReferenceContributor.java | Registers reference providers for @Ignored(prefix=...) and @Ignored(targets=...). |
| src/main/java/org/mapstruct/intellij/codeinsight/references/MapstructKotlinReferenceContributor.java | Registers Kotlin reference providers for @Ignored(prefix=...) and @Ignored(targets=...). |
| src/main/java/org/mapstruct/intellij/codeinsight/references/MapstructIgnoredTargetReference.java | New reference implementation for @Ignored#targets with prefix-aware type resolution. |
| src/main/java/org/mapstruct/intellij/codeinsight/references/BaseTargetReference.java | New shared base class for target references (resolve + variants + type logic). |
| description.html | Updates plugin description to mention @Ignored completion/references/inspections. |
| change-notes.html | Adds release notes entry documenting @Ignored support. |
| build.gradle | Bumps MapStruct dependency to 1.7 beta and updates jar rename logic; updates AssertJ. |
| README.md | Documents @Ignored support in feature list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
The Kotlin element pattern for @ignored used `insideAnnotationParam` which only matches standalone annotations. Changed to use `insideRepeatableAnnotationParam` with `IGNORED_LIST_ANNOTATION_FQN` so references and completion work when @ignored is nested inside @IgnoredList. Also fixed `insideRepeatableAnnotationParam` in `KotlinElementPattern` to use `withAncestor(2, ...)` instead of `withParent(...)` to support array parameters like `targets = ["..."]` where a collection literal sits between the string and the value argument. Added tests for @IgnoredList in both Java and Kotlin: - Completion with @IgnoredList container (Java and Kotlin) - Standalone @ignored completion in Kotlin - TargetPropertyMappedMoreThanOnce inspection with @IgnoredList
| Back | FazBrowse Home | New Git URL |
Summary
Closes #237, closes #238
Add support for the @Ignored annotation introduced in MapStruct 1.7:
Also refactors MapstructTargetReference by extracting shared logic into BaseTargetReference, reused by both MapstructTargetReference and the new MapstructIgnoredTargetReference. Generalizes extractMappingAnnotationsFromMappings to extractRepeatableAnnotations for reuse with @IgnoredList.
Test plan