How to write custom inspection for duplicate annotations in Intellij Idea?

154 Views Asked by At

Test methods is annotated with values, this values must be uniq. I want an inspection in IDEA that highlights duplicate annotation. Duplicates may be in different java files

Example

@Link(type = "manual", value = "123456")<-this must be highlighte
void someTest1(){
}

@Link(type = "manual", value = "654321")
void someTest2{
}

@Link(type = "manual", value = "123456")<-and this must be highlighted, because of the same value
void someTest3(){
}
1

There are 1 best solutions below

0
Olga Klisho On

You may create a feature request for the inpsection at YouTrack: https://youtrack.jetbrains.com/issues/IDEA or you may also implement such an inspection as plugin using the available sources: https://github.com/JetBrains/intellij-community