PsiElement (OffsetsInFile offsets, int offset, PsiFile originalFile) { PsiElement insertedElement = offsets.getFile().findElementAt(offset); if (insertedElement == null && offsets.getFile().getTextLength() == offset) { insertedElement = PsiTreeUtil.getDeepestLast(offsets.getFile()); } CompletionAssertions.assertCompletionPositionPsiConsistent(offsets, offset, originalFile, insertedElement); return insertedElement; }