Create From Usage: Restrict type guess search scope to prevent performance problem with highlighting

This commit is contained in:
Alexey Sedunov
2015-01-15 16:42:19 +03:00
parent 6f94ebb9d6
commit 90e7d2151b
@@ -189,8 +189,7 @@ fun JetExpression.guessTypes(
}
private fun JetNamedDeclaration.guessType(context: BindingContext): Array<JetType> {
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]
}