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 inspection for targeting the same class multiple times in a mixin #2356

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

O7410
Copy link
Contributor

@O7410 O7410 commented Aug 10, 2024

Currently it's a weak warning

@O7410 O7410 marked this pull request as draft August 11, 2024 15:06
@RedNesto
Copy link
Member

This is looking pretty good, there's a few things to note:

  • this does not cover cases where a class literal and string target both reference the same class
  • it would be nice to have some tests for this inspection, you can use InvalidInjectorMethodSignatureInspectionTest as a reference.
  • you should be fine getting PsiClass.mixinTargets once and pass it around, instead of hitting the cache again and again

@O7410
Copy link
Contributor Author

O7410 commented Aug 13, 2024

Take a look at the latest commit

}

fixture.enableInspections(MixinDuplicateTargetInspection::class)
fixture.checkHighlighting(false, false, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add one last true argument to remove the undesired unresolved highlights.

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.

2 participants