CompletionParameters (CompletionInitializationContext initContext, CompletionProcess indicator, OffsetsInFile finalOffsets) { int offset = finalOffsets.getOffsets().getOffset(CompletionInitializationContext.START_OFFSET); PsiFile fileCopy = finalOffsets.getFile(); PsiFile originalFile = fileCopy.getOriginalFile(); PsiElement insertedElement = findCompletionPositionLeaf(finalOffsets, offset, originalFile); insertedElement.putUserData(CompletionContext.COMPLETION_CONTEXT_KEY, new CompletionContext(fileCopy, finalOffsets.getOffsets())); return new CompletionParameters(insertedElement, originalFile, initContext.getCompletionType(), offset, initContext.getInvocationCount(), initContext.getEditor(), indicator); }