【问题标题】:How to write custom inspection for duplicate annotations in Intellij Idea?如何在 Intellij Idea 中为重复注释编写自定义检查?
【发布时间】:2021-12-13 13:57:11
【问题描述】:

测试方法用值注释,这个值必须是唯一的。 我想要在 IDEA 中进行检查以突出显示重复的注释。重复项可能在不同的 java 文件中

例子

@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(){
}

【问题讨论】:

    标签: java intellij-idea intellij-inspections


    【解决方案1】:

    您可以在 YouTrack 上为 inpsection 创建功能请求: https://youtrack.jetbrains.com/issues/IDEA 或者您也可以使用可用的资源来实现这样的检查作为插件: https://github.com/JetBrains/intellij-community

    【讨论】:

      猜你喜欢
      • 2014-07-23
      • 1970-01-01
      • 2017-03-01
      • 1970-01-01
      • 2020-07-03
      • 1970-01-01
      • 2013-05-08
      • 1970-01-01
      相关资源
      最近更新 更多