void handleTemplateInsert(List<? extends LookupElement> elements, final char completionChar) {
    InsertionContext context = createInsertionContext(this, myState.getPsiFile(), elements, myState.getEditor(), completionChar);
    WriteAction.run(() -> {
      doHandleInsert(context);
      if (context.shouldAddCompletionChar()) {
        CodeCompletionHandlerBase.addCompletionChar(context, this);
      }
    });
    Disposer.dispose(context.getOffsetMap());

    if (handleCompletionChar(context) && !myState.isFinished()) {
      myState.calcResults(true);
      myState.considerNextTabOnLookupItemSelected(getDelegate());
    }
  }
void handleTemplateInsert(List<? extends LookupElement> elements, final char completionChar)