Platform header IDE annotation: do not report suppressed error #KT-15601 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-01-10 13:38:24 +03:00
parent 76ee6d7712
commit b0a333456e
4 changed files with 25 additions and 1 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.highlighter
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.lang.annotation.Annotator
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.caches.resolve.KotlinCacheService
import org.jetbrains.kotlin.descriptors.MemberDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.PlatformKind
@@ -67,6 +68,10 @@ class PlatformHeaderAnnotator : Annotator {
checker.checkHeaderDeclarationHasImplementation(declaration, descriptor, diagnosticSink, checkImpl = false)
}
return if (diagnosticList.isNotEmpty()) SimpleDiagnostics(diagnosticList) else Diagnostics.EMPTY
val suppressionCache = KotlinCacheService.getInstance(declaration.project).getSuppressionCache()
val filteredList = diagnosticList.filter {
!suppressionCache.isSuppressed(declaration, it.factory.name, it.severity)
}
return if (filteredList.isNotEmpty()) SimpleDiagnostics(filteredList) else Diagnostics.EMPTY
}
}