KT-24146: Fix inserts imports automatically

Even if "add unambiguous imports on the fly" is off

 #KT-24146 fixed
This commit is contained in:
Simon Ogorodnik
2018-05-04 15:02:56 +03:00
parent 9de174959e
commit 6967028fdb
@@ -47,6 +47,8 @@ class KotlinReferenceImporter : ReferenceImporter {
val nameExpression = file.findElementAt(offset)?.parent as? KtSimpleNameExpression ?: return false
if (!CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY) return false
val importFix: ImportFixBase<out KtExpression>? = findImportFixAt(editor, file, offset)
if (importFix != null && !importFix.isOutdated()) {
val addImportAction = importFix.createAction(file.project, editor, nameExpression)