@Override
    public void handleInsert(@NotNull InsertionContext context) {
      int startOffset = context.getStartOffset();
      int endOffset = context.getEditor().getCaretModel().getOffset();
      Document document = context.getDocument();
      String canonicalText = myModel.getCanonicalText();
      document.replaceString(startOffset, endOffset, canonicalText);
      PsiDocumentManager.getInstance(context.getProject()).commitDocument(document);
      PsiElement deconstructionElement;
      if (!myModel.onlyDeconstructionList) {
        deconstructionElement = PsiTreeUtil.getParentOfType(context.getFile().findElementAt(startOffset), PsiDeconstructionPattern.class);
      }
      else {
        deconstructionElement = PsiTreeUtil.getParentOfType(context.getFile().findElementAt(startOffset), PsiDeconstructionList.class);
      }
      TextRange deconstructionRange = deconstructionElement == null ? null : deconstructionElement.getTextRange();
      if (deconstructionRange == null || deconstructionRange.getStartOffset() != startOffset || deconstructionRange.getLength() != canonicalText.length()) {
        document.replaceString(startOffset, startOffset + canonicalText.length(), myModel.toString());
        return;
      }
      deconstructionElement = JavaCodeStyleManager.getInstance(context.getProject()).shortenClassReferences(deconstructionElement);
      context.setTailOffset(deconstructionElement.getTextRange().getEndOffset());
      super.handleInsert(context);
    }
@Override
    public void handleInsert(@NotNull InsertionContext context)