mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[kotlin] Search references in full project scope
Use scope won't be able to find all references to the declaration. #KTIJ-28474 Fixed GitOrigin-RevId: 71f3c6088d4df9aa6f1801df3787c5e31b57812c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0e3c67fc4e
commit
8ca9796635
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.analysis.api.symbols.*
|
||||
import org.jetbrains.kotlin.analysis.api.types.KaFunctionType
|
||||
import org.jetbrains.kotlin.asJava.toLightElements
|
||||
import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferences
|
||||
import org.jetbrains.kotlin.idea.base.util.projectScope
|
||||
import org.jetbrains.kotlin.idea.k2.refactoring.move.processor.K2MoveRenameUsageInfo.Companion.updatableUsageInfo
|
||||
import org.jetbrains.kotlin.idea.references.KtConstructorDelegationReference
|
||||
import org.jetbrains.kotlin.idea.references.KtInvokeFunctionReference
|
||||
@@ -275,7 +276,7 @@ sealed class K2MoveRenameUsageInfo(
|
||||
* Finds usages to [declaration] excluding the usages inside [declaration].
|
||||
*/
|
||||
fun findExternalUsages(declaration: KtNamedDeclaration): List<MoveRenameUsageInfo> {
|
||||
val allUsages = ReferencesSearch.search(declaration, declaration.useScope).findAll()
|
||||
val allUsages = ReferencesSearch.search(declaration, declaration.project.projectScope()).findAll()
|
||||
.filter { !declaration.isAncestor(it.element) } // exclude internal usages
|
||||
.mapNotNull { ref ->
|
||||
val element = ref.element
|
||||
|
||||
Reference in New Issue
Block a user