Looking for text usages in all project (e. g., class can be referred from test data).

This commit is contained in:
Evgeny Gerashchenko
2015-01-16 14:48:41 +03:00
parent 9ba86501ec
commit 460fae275b
@@ -97,14 +97,13 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() {
private fun classHasTextUsages(klass: JetClass): Boolean {
var hasTextUsages = false
val classUseScope = klass.getUseScope()
// Finding text usages
if (classUseScope is GlobalSearchScope) {
if (klass.getUseScope() is GlobalSearchScope) {
val findClassUsagesHandler = KotlinFindClassUsagesHandler(klass, KotlinFindUsagesHandlerFactory(klass.getProject()))
findClassUsagesHandler.processUsagesInText(
klass,
{ hasTextUsages = true; false },
classUseScope
GlobalSearchScope.projectScope(klass.getProject())
)
}