void (final int time) { PsiDocumentManager.getInstance(myProject).commitAllDocuments(); new CodeCompletionHandlerBase(myType).invokeCompletion(myProject, InjectedLanguageUtil .getEditorForInjectedLanguageNoCommit(myEditor, getFile()), time); LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor); myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY); myPrefix = lookup == null ? "" : lookup.itemPattern(lookup.getItems().get(0)); }