diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaDocumentationProvider.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaDocumentationProvider.java index eca85cb2a340..31c2ed3b1bff 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaDocumentationProvider.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaDocumentationProvider.java @@ -111,14 +111,14 @@ public class JsonSchemaDocumentationProvider implements DocumentationProvider { return htmlDescription == null ? null - : appendNameTypeAndApi(position, getThirdPartyApiInfo(element, rootSchema), possibleTypes, htmlDescription); + : appendNameTypeAndApi(position, getThirdPartyApiInfo(element, rootSchema), possibleTypes, htmlDescription, preferShort); } @NotNull private static String appendNameTypeAndApi(@NotNull List position, @NotNull String apiInfo, @NotNull List possibleTypes, - @NotNull String htmlDescription) { + @NotNull String htmlDescription, boolean preferShort) { if (position.size() == 0) return htmlDescription; JsonSchemaVariantsTreeBuilder.Step lastStep = position.get(position.size() - 1); @@ -131,8 +131,13 @@ public class JsonSchemaDocumentationProvider implements DocumentationProvider { type = ": " + schemaType; } - htmlDescription = DocumentationMarkup.DEFINITION_START + name + type + apiInfo + DocumentationMarkup.DEFINITION_END + - DocumentationMarkup.CONTENT_START + htmlDescription + DocumentationMarkup.CONTENT_END; + if (preferShort) { + htmlDescription = "" + name + "" + type + apiInfo + "
" + htmlDescription; + } + else { + htmlDescription = DocumentationMarkup.DEFINITION_START + name + type + apiInfo + DocumentationMarkup.DEFINITION_END + + DocumentationMarkup.CONTENT_START + htmlDescription + DocumentationMarkup.CONTENT_END; + } return htmlDescription; } diff --git a/json/tests/testData/jsonSchema/documentation/checkEscaping_short.html b/json/tests/testData/jsonSchema/documentation/checkEscaping_short.html index cc83a42c906e..b0a818c9610d 100644 --- a/json/tests/testData/jsonSchema/documentation/checkEscaping_short.html +++ b/json/tests/testData/jsonSchema/documentation/checkEscaping_short.html @@ -1 +1 @@ -
no-reference
Disallows /// <reference path=> imports (use ES6-style imports instead)
\ No newline at end of file +no-reference
Disallows /// <reference path=> imports (use ES6-style imports instead) \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/htmlDescription_short.html b/json/tests/testData/jsonSchema/documentation/htmlDescription_short.html index c84c67bc2eb7..b64a867b9d9b 100644 --- a/json/tests/testData/jsonSchema/documentation/htmlDescription_short.html +++ b/json/tests/testData/jsonSchema/documentation/htmlDescription_short.html @@ -1 +1 @@ -
ccc
Hello and enjoy new description!
\ No newline at end of file +ccc
Hello and enjoy new description! \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/secondLevel_short.html b/json/tests/testData/jsonSchema/documentation/secondLevel_short.html index 7370b9835a08..12c7631017b0 100644 --- a/json/tests/testData/jsonSchema/documentation/secondLevel_short.html +++ b/json/tests/testData/jsonSchema/documentation/secondLevel_short.html @@ -1 +1 @@ -
my_second_level_property
my second level property description 1
\ No newline at end of file +my_second_level_property
my second level property description 1 \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/simple_short.html b/json/tests/testData/jsonSchema/documentation/simple_short.html index f7bf15828096..7faf19391780 100644 --- a/json/tests/testData/jsonSchema/documentation/simple_short.html +++ b/json/tests/testData/jsonSchema/documentation/simple_short.html @@ -1 +1 @@ -
my_property
my property description 1
\ No newline at end of file +my_property
my property description 1 \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/withDefinition_short.html b/json/tests/testData/jsonSchema/documentation/withDefinition_short.html index f1616b0a75d4..7a9a3abd9dc0 100644 --- a/json/tests/testData/jsonSchema/documentation/withDefinition_short.html +++ b/json/tests/testData/jsonSchema/documentation/withDefinition_short.html @@ -1 +1 @@ -
source
Description found through definition
\ No newline at end of file +source
Description found through definition \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/withTitleInDefinition_short.html b/json/tests/testData/jsonSchema/documentation/withTitleInDefinition_short.html index 01b00368b2dc..b7e34ac6ff92 100644 --- a/json/tests/testData/jsonSchema/documentation/withTitleInDefinition_short.html +++ b/json/tests/testData/jsonSchema/documentation/withTitleInDefinition_short.html @@ -1 +1 @@ -
source
Title found through definition
\ No newline at end of file +source
Title found through definition \ No newline at end of file