From 90e7d2151ba3a1102f6ff774ce0b725b5e60dc27 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 15 Jan 2015 16:42:19 +0300 Subject: [PATCH] Create From Usage: Restrict type guess search scope to prevent performance problem with highlighting --- .../idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt index abde7cccc51..d152c81e710 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt @@ -189,8 +189,7 @@ fun JetExpression.guessTypes( } private fun JetNamedDeclaration.guessType(context: BindingContext): Array { - val scope = getContainingFile()!!.getUseScope() - val expectedTypes = SearchUtils.findAllReferences(this, scope)!!.stream().map { ref -> + val expectedTypes = SearchUtils.findAllReferences(this, getUseScope())!!.stream().map { ref -> if (ref is JetSimpleNameReference) { context[BindingContext.EXPECTED_EXPRESSION_TYPE, ref.expression] }