Don't run inspection for test data.

This commit is contained in:
Evgeny Gerashchenko
2015-01-27 18:15:18 +03:00
parent a6362dda22
commit f96f1b8cb0
@@ -61,6 +61,7 @@ import com.intellij.refactoring.safeDelete.SafeDeleteHandler
import org.jetbrains.kotlin.psi.JetPsiUtil
import org.jetbrains.kotlin.psi.JetObjectDeclaration
import org.jetbrains.kotlin.psi.JetClassOrObject
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil
public class UnusedSymbolInspection : AbstractKotlinInspection() {
private val javaInspection = UnusedDeclarationInspection()
@@ -92,6 +93,8 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() {
else -> return
}
if (!ProjectRootsUtil.isInProjectSource(declaration)) return
// Simple PSI-based checks
if (declaration.getName() == null) return
if (declaration is JetEnumEntry) return