From f5d61a6d1611f6123fefc6671e45e71d9197eaa8 Mon Sep 17 00:00:00 2001 From: Anton Lobov Date: Tue, 17 Jul 2018 10:58:21 +0200 Subject: [PATCH] WEB-33908 JSON Schema completion: show types in completion item descriptions when no description is avaiable --- .../jsonSchema/impl/JsonSchemaCompletionContributor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCompletionContributor.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCompletionContributor.java index cba9dbb37ba0..52d349df3a0e 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCompletionContributor.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCompletionContributor.java @@ -308,6 +308,12 @@ public class JsonSchemaCompletionContributor extends CompletionContributor { if (!StringUtil.isEmptyOrSpaces(typeText)) { builder = builder.withTypeText(StringUtil.removeHtmlTags(typeText), true); } + else { + JsonSchemaType type = jsonSchemaObject.getType(); + if (type != null) { + builder = builder.withTypeText(type.getDescription(), true); + } + } builder = builder.withIcon(getIcon(jsonSchemaObject.getType()));