Add test for inspections suppression

This commit is contained in:
Nikolay Krasko
2015-12-14 17:58:20 +03:00
committed by Nikolay Krasko
parent aff83087a3
commit 8196621be5
9 changed files with 98 additions and 13 deletions
@@ -158,7 +158,14 @@ public class KotlinCacheService(val project: Project) {
private val kotlinSuppressCache: CachedValue<KotlinSuppressCache> = CachedValuesManager.getManager(project).createCachedValue({
CachedValueProvider.Result<KotlinSuppressCache>(object : KotlinSuppressCache() {
override fun getSuppressionAnnotations(annotated: KtAnnotated): List<AnnotationDescriptor> {
val context = annotated.analyze(BodyResolveMode.PARTIAL)
val context =
if (annotated is KtFile) {
annotated.fileAnnotationList?.analyze(BodyResolveMode.PARTIAL) ?: return emptyList()
}
else {
annotated.analyze(BodyResolveMode.PARTIAL)
}
val annotatedDescriptor = context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, annotated)
if (annotatedDescriptor != null) {