提交 87ba6081 编写于 作者: C caikang.ck

support SuppressWarning annotation

上级 54bbd465
......@@ -32,10 +32,9 @@ import org.jetbrains.annotations.Nls
* @author caikang
* @date 2016/12/16
*/
class AliPmdInspection(private val ruleName: String)
: LocalInspectionTool(),
AliBaseInspection,
PmdRuleInspectionIdentify {
class AliPmdInspection(private val ruleName: String) : LocalInspectionTool(),
AliBaseInspection,
PmdRuleInspectionIdentify {
override fun manualBuildFix(psiElement: PsiElement, isOnTheFly: Boolean): LocalQuickFix? {
return QuickFixes.getQuickFix(ruleName, isOnTheFly)
}
......@@ -62,8 +61,10 @@ class AliPmdInspection(private val ruleName: String)
return true
}
override fun checkFile(file: PsiFile, manager: InspectionManager,
isOnTheFly: Boolean): Array<ProblemDescriptor>? {
override fun checkFile(
file: PsiFile, manager: InspectionManager,
isOnTheFly: Boolean
): Array<ProblemDescriptor>? {
if (!shouldInspectChecker.shouldInspect(file)) {
return null
}
......@@ -96,10 +97,6 @@ class AliPmdInspection(private val ruleName: String)
return true
}
override fun isSuppressedFor(element: PsiElement): Boolean {
return false
}
override fun getShortName(): String {
var shortName = "Alibaba" + ruleName
......
......@@ -45,8 +45,10 @@ class DelegateLocalInspectionTool : LocalInspectionTool(), AliBaseInspection {
return localInspectionTool.runForWholeFile()
}
override fun checkFile(file: PsiFile, manager: InspectionManager,
isOnTheFly: Boolean): Array<ProblemDescriptor>? {
override fun checkFile(
file: PsiFile, manager: InspectionManager,
isOnTheFly: Boolean
): Array<ProblemDescriptor>? {
return localInspectionTool.checkFile(file, manager, isOnTheFly)
}
......@@ -81,11 +83,13 @@ class DelegateLocalInspectionTool : LocalInspectionTool(), AliBaseInspection {
}
override fun isSuppressedFor(element: PsiElement): Boolean {
return false
return localInspectionTool.isSuppressedFor(element)
}
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean,
session: LocalInspectionToolSession): PsiElementVisitor {
override fun buildVisitor(
holder: ProblemsHolder, isOnTheFly: Boolean,
session: LocalInspectionToolSession
): PsiElementVisitor {
if (!AliLocalInspectionToolProvider.javaShouldInspectChecker.shouldInspect(holder.file)) {
return PsiElementVisitor.EMPTY_VISITOR
}
......
......@@ -78,6 +78,6 @@ class DelegatePmdInspection : LocalInspectionTool(), AliBaseInspection, PmdRuleI
}
override fun isSuppressedFor(element: PsiElement): Boolean {
return false
return aliPmdInspection.isSuppressedFor(element)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册