@Override
    public void itemSelected(@NotNull LookupEvent event) {
      LookupElement item = event.getItem();
      if (item == null) return;

      char c = event.getCompletionChar();
      if (myCheckCompletionChar && !LookupEvent.isSpecialCompletionChar(c)) {
        return;
      }

      final Project project = myContext.getProject();
      if (project == null) {
        return;
      }

      ApplicationManager.getApplication().invokeLater(() -> WriteCommandAction.runWriteCommandAction(project, ()-> {
          Editor editor = myContext.getEditor();
          if (editor != null) {
            TemplateState templateState = TemplateManagerImpl.getTemplateState(editor);
            if (templateState != null) {
              templateState.considerNextTabOnLookupItemSelected(item);
            }
          }
        }), ModalityState.current(), project.getDisposed());

    }
@Override
    public void itemSelected(@NotNull LookupEvent event)