void (@NotNull String key, @NotNull JsonSchemaObject jsonSchemaObject, boolean hasValue, boolean insertComma, @Nullable SchemaPath completionPath) { final Collection<JsonSchemaObject> variants = new JsonSchemaResolver(myProject, jsonSchemaObject).resolve(); jsonSchemaObject = ObjectUtils.coalesce(ContainerUtil.getFirstItem(variants), jsonSchemaObject); key = !shouldWrapInQuotes(key, false) ? key : StringUtil.wrapWithDoubleQuote(key); LookupElementBuilder builder = LookupElementBuilder.create(key); final String typeText = JsonSchemaDocumentationProvider.getBestDocumentation(true, jsonSchemaObject); if (!StringUtil.isEmptyOrSpaces(typeText)) { final String text = StringUtil.removeHtmlTags(typeText); builder = builder.withTypeText(findFirstSentence(text), true); } else { String type = jsonSchemaObject.getTypeDescription(true); if (type != null) { builder = builder.withTypeText(type, true); } } builder = builder.withIcon(getIcon(jsonSchemaObject.guessType())); if (hasSameType(variants)) { final JsonSchemaType type = jsonSchemaObject.guessType(); final List<Object> values = jsonSchemaObject.getEnum(); Object defaultValue = jsonSchemaObject.getDefault(); boolean hasValues = !ContainerUtil.isEmpty(values); if (type != null || hasValues || defaultValue != null) { builder = builder.withInsertHandler( !hasValues || values.stream().map(v -> v.getClass()).distinct().count() == 1 ? createPropertyInsertHandler(jsonSchemaObject, hasValue, insertComma) : createDefaultPropertyInsertHandler(true, insertComma)); } else { builder = builder.withInsertHandler(createDefaultPropertyInsertHandler(hasValue, insertComma)); } } else { builder = builder.withInsertHandler(createDefaultPropertyInsertHandler(hasValue, insertComma)); } String deprecationMessage = jsonSchemaObject.getDeprecationMessage(); if (deprecationMessage != null) { builder = builder.withTailText(JsonBundle.message("schema.documentation.deprecated.postfix"), true).withStrikeoutness(true); } myVariants.add(NestedCompletionsKt.prefixedBy(builder, completionPath, myWalker)); }