mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JSON: restore nice-looking tooltips for ctrl+hover
This commit is contained in:
@@ -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<JsonSchemaVariantsTreeBuilder.Step> position,
|
||||
@NotNull String apiInfo,
|
||||
@NotNull List<JsonSchemaType> 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 = "<b>" + name + "</b>" + type + apiInfo + "<br/>" + htmlDescription;
|
||||
}
|
||||
else {
|
||||
htmlDescription = DocumentationMarkup.DEFINITION_START + name + type + apiInfo + DocumentationMarkup.DEFINITION_END +
|
||||
DocumentationMarkup.CONTENT_START + htmlDescription + DocumentationMarkup.CONTENT_END;
|
||||
}
|
||||
return htmlDescription;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>no-reference</pre></div><div class='content'>Disallows /// <reference path=> imports (use ES6-style imports instead)</div>
|
||||
<b>no-reference</b><br/>Disallows /// <reference path=> imports (use ES6-style imports instead)
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>ccc</pre></div><div class='content'><b>Hello</b> and <font color="blue">enjoy</font> <i>new</i> <a href="http://google.com">description!</a></div>
|
||||
<b>ccc</b><br/><b>Hello</b> and <font color="blue">enjoy</font> <i>new</i> <a href="http://google.com">description!</a>
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>my_second_level_property</pre></div><div class='content'>my second level property description 1</div>
|
||||
<b>my_second_level_property</b><br/>my second level property description 1
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>my_property</pre></div><div class='content'>my property description 1</div>
|
||||
<b>my_property</b><br/>my property description 1
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>source</pre></div><div class='content'>Description found through definition</div>
|
||||
<b>source</b><br/>Description found through definition
|
||||
@@ -1 +1 @@
|
||||
<div class='definition'><pre>source</pre></div><div class='content'>Title found through definition</div>
|
||||
<b>source</b><br/>Title found through definition
|
||||
Reference in New Issue
Block a user