KotlinFindUsagesHandler: cleanup after J2K
This commit is contained in:
@@ -30,14 +30,17 @@ import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesHandlerFactory
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
|
|
||||||
public abstract class KotlinFindUsagesHandler<T : PsiElement>(psiElement: T, private val elementsToSearch: Collection<PsiElement>, public val factory: KotlinFindUsagesHandlerFactory) : FindUsagesHandler(psiElement) {
|
public abstract class KotlinFindUsagesHandler<T : PsiElement>(psiElement: T,
|
||||||
|
private val elementsToSearch: Collection<PsiElement>,
|
||||||
|
public val factory: KotlinFindUsagesHandlerFactory)
|
||||||
|
: FindUsagesHandler(psiElement) {
|
||||||
|
|
||||||
@suppress("UNCHECKED_CAST")
|
@suppress("UNCHECKED_CAST")
|
||||||
public fun getElement(): T {
|
public fun getElement(): T {
|
||||||
return getPsiElement() as T
|
return getPsiElement() as T
|
||||||
}
|
}
|
||||||
|
|
||||||
public constructor(psiElement: T, factory: KotlinFindUsagesHandlerFactory) : this(psiElement, emptyList<PsiElement>(), factory) {
|
public constructor(psiElement: T, factory: KotlinFindUsagesHandlerFactory) : this(psiElement, emptyList(), factory) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPrimaryElements(): Array<PsiElement> {
|
override fun getPrimaryElements(): Array<PsiElement> {
|
||||||
@@ -54,11 +57,9 @@ public abstract class KotlinFindUsagesHandler<T : PsiElement>(psiElement: T, pri
|
|||||||
|
|
||||||
if (searchText) {
|
if (searchText) {
|
||||||
if (options.fastTrack != null) {
|
if (options.fastTrack != null) {
|
||||||
options.fastTrack.searchCustom(object : Processor<Processor<PsiReference>> {
|
options.fastTrack.searchCustom {
|
||||||
override fun process(consumer: Processor<PsiReference>): Boolean {
|
processUsagesInText(element, processor, scope as GlobalSearchScope)
|
||||||
return processUsagesInText(element, processor, scope as GlobalSearchScope)
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return processUsagesInText(element, processor, scope as GlobalSearchScope)
|
return processUsagesInText(element, processor, scope as GlobalSearchScope)
|
||||||
|
|||||||
Reference in New Issue
Block a user