diff --git a/java/java-tests/testData/codeInsight/documentation/EscapingLink.html b/java/java-tests/testData/codeInsight/documentation/EscapingLink.html index 8febb71e560a..0f3554f979e0 100644 --- a/java/java-tests/testData/codeInsight/documentation/EscapingLink.html +++ b/java/java-tests/testData/codeInsight/documentation/EscapingLink.html @@ -26,4 +26,4 @@ -
 myLib \ No newline at end of file +
 myLib
`genericMethod(Class<?>)` on localhost
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/documentation/LinkBetweenMethods.html b/java/java-tests/testData/codeInsight/documentation/LinkBetweenMethods.html index f5df8a59bf22..a0ff4436bfca 100644 --- a/java/java-tests/testData/codeInsight/documentation/LinkBetweenMethods.html +++ b/java/java-tests/testData/codeInsight/documentation/LinkBetweenMethods.html @@ -19,4 +19,4 @@
m2()
-
 myLib \ No newline at end of file +
 myLib
`m1()` on localhost
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/documentation/LinkToPackageSummaryWithReference.html b/java/java-tests/testData/codeInsight/documentation/LinkToPackageSummaryWithReference.html index 8d84d9fea5ea..5e4ac8d60ce9 100644 --- a/java/java-tests/testData/codeInsight/documentation/LinkToPackageSummaryWithReference.html +++ b/java/java-tests/testData/codeInsight/documentation/LinkToPackageSummaryWithReference.html @@ -24,4 +24,4 @@ -
 myLib \ No newline at end of file +
 myLib
`SimpleInterface` on localhost
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/documentation/LinkWithReference.html b/java/java-tests/testData/codeInsight/documentation/LinkWithReference.html index 89b36764ce54..879f2447e10c 100644 --- a/java/java-tests/testData/codeInsight/documentation/LinkWithReference.html +++ b/java/java-tests/testData/codeInsight/documentation/LinkWithReference.html @@ -32,4 +32,4 @@ extends java.lang.Object -
 myLib \ No newline at end of file +
 myLib
`ClassWithRefLink` on localhost
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html b/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html index 1e84f17b3e2a..873a1a7f0404 100644 --- a/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html +++ b/java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html @@ -26,4 +26,4 @@ -
 myLib \ No newline at end of file +
 myLib
`param()` on localhost
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html b/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html index 4160fa196ddf..85fb52bfeab3 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html +++ b/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html @@ -5,4 +5,4 @@ at least one element e such that (o==null ? e==null : o.equals(e)). -

Overrides:

contains in interface Collection

Params:

o – element whose presence in this list is to be tested

Returns:

true if this list contains the specified element

Throws:

ClassCastException – if the type of the specified element is incompatible with this list (optional)

NullPointerException – if the specified element is null and this list does not permit null elements (optional)

 < java 1.7 > +

Overrides:

contains in interface Collection

Params:

o – element whose presence in this list is to be tested

Returns:

true if this list contains the specified element

Throws:

ClassCastException – if the type of the specified element is incompatible with this list (optional)

NullPointerException – if the specified element is null and this list does not permit null elements (optional)

 < java 1.7 >
\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html b/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html index 5ec42e55d0ba..4267b3a0a4f5 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html +++ b/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html @@ -2,4 +2,4 @@ @NotNull  @Contract(pure = true)  public java.lang.reflect.Constructor<?>[] getDeclaredConstructors() -throws SecurityException

Throws:

SecurityException

 < java 10 > \ No newline at end of file +throws SecurityException

Throws:

SecurityException

 < java 10 >
\ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/JavaDocumentationTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/JavaDocumentationTest.kt index efea7176948d..9568d1691240 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/JavaDocumentationTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/JavaDocumentationTest.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.java.codeInsight import com.intellij.codeInsight.documentation.DocumentationManager @@ -326,7 +326,7 @@ class JavaDocumentationTest : LightJavaCodeInsightFixtureTestCase() { // Here we check that the covering module (SDK in this case) is rendered in decorated info assertTrue( - component.decoratedText.contains("
 < java 1.7 >")) + component.decoratedText.contains("
 < java 1.7 >
")) return@getDocumentationText null } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationHtmlUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationHtmlUtil.java index 783c760c5205..776921783544 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationHtmlUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationHtmlUtil.java @@ -68,11 +68,8 @@ public final class DocumentationHtmlUtil { " border-bottom: thin solid " + borderColor + "; }", ".bottom { padding: 3px 16px 0 " + leftPadding + "px; }", ".download-documentation { padding: 0px 0px 18px; }", - ".separator-container { padding: 18px " + leftPadding + "px 0px; }", - ".separator-container .separator { border-top: thin solid " + borderColor + "; }", ".bottom-no-content { padding: 5px 16px 0 " + leftPadding + "px; }", ".grayed { color: #909090; display: inline;}", - ".location .spacer { padding-top: 8px }", // sections table ".sections { padding: 0 16px 0 " + leftPadding + "px; border-spacing: 0; }", diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java index 14bab00fee8d..37a6a4e9f8b9 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java @@ -1904,7 +1904,8 @@ public class DocumentationManager extends DockablePopupManager", ""); text = replaceIgnoreQuotesType(text, SECTIONS_START + SECTIONS_END, ""); text = replaceIgnoreQuotesType(text, SECTIONS_START + "

" + SECTIONS_END, ""); //NON-NLS - if (!containsIgnoreQuotesType(text, CONTENT_START)) { + boolean hasContent = containsIgnoreQuotesType(text, CONTENT_START); + if (!hasContent) { if (!containsIgnoreQuotesType(text, DEFINITION_START)) { int bodyStart = findContentStart(text); if (bodyStart > 0) { @@ -1916,6 +1917,7 @@ public class DocumentationManager extends DockablePopupManager

");
@@ -1924,21 +1926,17 @@ public class DocumentationManager extends DockablePopupManager
       presentation.locationIcon?.let { locationIcon ->
         val iconKey = registerIcon(locationIcon)
-        getLocationChunk(locationText, iconKey)
+        HtmlChunk.fragment(
+          HtmlChunk.tag("icon").attr("src", iconKey),
+          HtmlChunk.nbsp(),
+          HtmlChunk.text(locationText)
+        )
       } ?: HtmlChunk.text(locationText)
     }
   }
 
-  private fun getLocationChunk(text: String, icon: String): HtmlChunk {
-    val separatorIndex = text.indexOfFirst { it == ':' } + 1
-    return if (separatorIndex > 0) {
-      return getLocationChunkWithProviderInfo(
-        text.substring(0, separatorIndex),
-        text.substring(separatorIndex),
-        icon
-      )
-    }
-    else {
-      getLocationChunkWithoutProviderInfo(text, icon)
-    }
-  }
-
-  private fun getLocationChunkWithProviderInfo(provider: @NlsSafe String, @NlsSafe location: String, icon: String) = HtmlChunk.div()
-    .setClass("location")
-    .children(
-      HtmlChunk.tag("icon").attr("src", icon),
-      HtmlChunk.nbsp(),
-      HtmlChunk.text(provider),
-      HtmlChunk.div().setClass("spacer"),
-      HtmlChunk.text(location)
-    )
-
-  private fun getLocationChunkWithoutProviderInfo(text: @NlsSafe String, icon: String) = HtmlChunk
-    .div()
-    .setClass("location")
-    .children(
-      HtmlChunk.tag("icon").attr("src", icon),
-      HtmlChunk.nbsp(),
-      HtmlChunk.text(text)
-    )
-
   private fun registerIcon(icon: Icon): String {
     val key = icons.size.toString()
     icons[key] = icon