void (Set<? super LookupElement> set, TailType tailType, @NotNull Object completion, final CompletionVariant variant) { LookupElement ret = objectToLookupItem(completion); if (!(ret instanceof LookupItem item)) { set.add(ret); return; } InsertHandler<?> insertHandler = variant.getInsertHandler(); if(insertHandler != null && item.getInsertHandler() == null) { item.setInsertHandler(insertHandler); item.setTailType(TailTypes.unknownType()); } else if (tailType != TailTypes.noneType()) { item.setTailType(tailType); } final Map<Object, Object> itemProperties = variant.getItemProperties(); for (final Object key : itemProperties.keySet()) { item.setAttribute(key, itemProperties.get(key)); } set.add(ret); }