void (@NotNull LookupEvent event) { LookupElement item = myLookup.getCurrentItem(); if (item != null && isSelectedByTyping(myLookup, item)) { triggerLookupUsed(FinishType.TYPED, item, event.getCompletionChar()); } else { FinishType detailedCancelType = event.isCanceledExplicitly() ? FinishType.CANCELED_EXPLICITLY : FinishType.CANCELED_BY_TYPING; triggerLookupUsed(detailedCancelType, null, event.getCompletionChar()); } }