one more check to avoid duplicate imports (PY-3167)

This commit is contained in:
Dmitry Jemerov
2011-04-02 20:01:52 +02:00
parent 398330883a
commit 96fcbcd5da
@@ -135,6 +135,7 @@ public class AutoImportQuickFix implements LocalQuickFix {
public void invoke(PsiFile file) throws IncorrectOperationException {
// make sure file is committed, writable, etc
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
if (ImportFromExistingAction.isResolved(myReference)) return;
// act
ImportFromExistingAction action = new ImportFromExistingAction(myNode, myImports, myName, myUseQualifiedImport);
action.execute(); // assume that action runs in WriteAction on its own behalf