void (@NotNull final LookupEvent event) { final LookupElement item = event.getItem(); assert item instanceof CustomLiveTemplateLookupElement; if (myFile != null) { WriteCommandAction.runWriteCommandAction(myProject, TextMateBundle.message("textmate.expand.live.template.command.name"), null, () -> ((CustomLiveTemplateLookupElement)item).expandTemplate(myEditor, myFile), myFile); } }