Create From Usage: Restrict type guess search scope to prevent performance problem with highlighting
This commit is contained in:
+1
-2
@@ -189,8 +189,7 @@ fun JetExpression.guessTypes(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun JetNamedDeclaration.guessType(context: BindingContext): Array<JetType> {
|
private fun JetNamedDeclaration.guessType(context: BindingContext): Array<JetType> {
|
||||||
val scope = getContainingFile()!!.getUseScope()
|
val expectedTypes = SearchUtils.findAllReferences(this, getUseScope())!!.stream().map { ref ->
|
||||||
val expectedTypes = SearchUtils.findAllReferences(this, scope)!!.stream().map { ref ->
|
|
||||||
if (ref is JetSimpleNameReference) {
|
if (ref is JetSimpleNameReference) {
|
||||||
context[BindingContext.EXPECTED_EXPRESSION_TYPE, ref.expression]
|
context[BindingContext.EXPECTED_EXPRESSION_TYPE, ref.expression]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user