Skip to content

Commit

Permalink
Support @Suppress kotlin annotation as primary annotation - #6
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbosch committed May 4, 2017
1 parent 8d520a6 commit 1e01f62
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fun KtElement.isSuppressedBy(id: String): Boolean {
* Checks if this kt element is suppressed by @Suppress or @SuppressWarnings annotations.
*/
fun KtAnnotated.isSuppressedBy(id: String): Boolean {
return annotationEntries.find { it.typeReferenceName == "SuppressWarnings" }
return annotationEntries.find { it.typeReferenceName.let { it == "Suppress" || it == "SuppressWarnings" } }
?.valueArguments
?.find { it.getArgumentExpression()?.text?.replace("\"", "") == id } != null
}

0 comments on commit 1e01f62

Please sign in to comment.