1
0
mirror of https://github.com/chylex/IntelliJ-Inspection-Lens.git synced 2024-10-17 12:42:47 +02:00

Compare commits

..

No commits in common. "223fceb6b91622cbdf3de43295af81fa8e5af0c1" and "1c92cf000fd93899d7382a2929712a261e6e9482" have entirely different histories.

5 changed files with 8 additions and 37 deletions

View File

@ -8,7 +8,7 @@ plugins {
} }
group = "com.chylex.intellij.inspectionlens" group = "com.chylex.intellij.inspectionlens"
version = "1.3.3" version = "1.3.2"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@ -1,23 +0,0 @@
package com.chylex.intellij.inspectionlens.compatibility
import com.chylex.intellij.inspectionlens.editor.LensSeverity
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.openapi.diagnostic.logger
import com.intellij.profile.codeInspection.InspectionProfileManager
import com.intellij.spellchecker.SpellCheckerSeveritiesProvider
object SpellCheckerSupport {
private val log = logger<SpellCheckerSupport>()
fun load() {
typoSeverity?.let { LensSeverity.registerMapping(it, LensSeverity.TYPO) }
}
private val typoSeverity: HighlightSeverity?
get() = try {
SpellCheckerSeveritiesProvider.TYPO
} catch (e: NoClassDefFoundError) {
log.warn("Falling back to registered severity search due to ${e.javaClass.simpleName}: ${e.message}")
InspectionProfileManager.getInstance().severityRegistrar.getSeverity("TYPO")
}
}

View File

@ -39,11 +39,13 @@ class LensRenderer(info: HighlightInfo) : HintRenderer(null) {
private companion object { private companion object {
private fun getValidDescriptionText(text: String?): String { private fun getValidDescriptionText(text: String?): String {
return if (text.isNullOrBlank()) " " else addMissingPeriod(unescapeHtmlEntities(text)) return if (text.isNullOrBlank()) " " else addMissingPeriod(convertHtmlToText(text))
} }
private fun unescapeHtmlEntities(potentialHtml: String): String { private fun convertHtmlToText(potentialHtml: String): String {
return potentialHtml.ifContains('&', StringUtil::unescapeXmlEntities) return potentialHtml
.ifContains('<') { StringUtil.stripHtml(it, " ") }
.ifContains('&', StringUtil::unescapeXmlEntities)
} }
private fun addMissingPeriod(text: String): String { private fun addMissingPeriod(text: String): String {

View File

@ -1,8 +1,8 @@
package com.chylex.intellij.inspectionlens.editor package com.chylex.intellij.inspectionlens.editor
import com.chylex.intellij.inspectionlens.InspectionLensRefresher import com.chylex.intellij.inspectionlens.InspectionLensRefresher
import com.chylex.intellij.inspectionlens.compatibility.SpellCheckerSupport
import com.intellij.lang.annotation.HighlightSeverity import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.spellchecker.SpellCheckerSeveritiesProvider
import com.intellij.ui.ColorUtil import com.intellij.ui.ColorUtil
import com.intellij.ui.ColorUtil.toAlpha import com.intellij.ui.ColorUtil.toAlpha
import com.intellij.ui.JBColor import com.intellij.ui.JBColor
@ -43,12 +43,9 @@ enum class LensSeverity(baseColor: Color, lightThemeDarkening: Int, darkThemeBri
HighlightSeverity.WARNING to WARNING, HighlightSeverity.WARNING to WARNING,
HighlightSeverity.WEAK_WARNING to WEAK_WARNING, HighlightSeverity.WEAK_WARNING to WEAK_WARNING,
HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING to SERVER_PROBLEM, HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING to SERVER_PROBLEM,
SpellCheckerSeveritiesProvider.TYPO to TYPO,
)) ))
init {
SpellCheckerSupport.load()
}
/** /**
* Registers a mapping from a [HighlightSeverity] to a [LensSeverity], and refreshes all open editors. * Registers a mapping from a [HighlightSeverity] to a [LensSeverity], and refreshes all open editors.
*/ */

View File

@ -17,11 +17,6 @@
]]></description> ]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
<b>Version 1.3.3</b>
<ul>
<li>Partially reverted fix for inspections that include HTML in their description due to breaking inspections with angled brackets.</li>
<li>Fixed plugin not working when installed on JetBrains Gateway Client.</li>
</ul>
<b>Version 1.3.2</b> <b>Version 1.3.2</b>
<ul> <ul>
<li>Fixed inspections randomly not disappearing.</li> <li>Fixed inspections randomly not disappearing.</li>