Compare commits

...

3 Commits

3 changed files with 17 additions and 11 deletions

View File

@ -4,11 +4,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.21"
id("org.jetbrains.intellij") version "1.7.0"
id("org.jetbrains.intellij") version "1.9.0"
}
group = "com.chylex.intellij.inspectionlens"
version = "1.0.0"
version = "1.1.0"
repositories {
mavenCentral()

View File

@ -63,17 +63,18 @@ class LensMarkupModelListener private constructor(editor: Editor) : MarkupModelL
companion object {
private val MINIMUM_SEVERITY = HighlightSeverity.TEXT_ATTRIBUTES.myVal + 1
private fun getHighlightInfoIfValid(highlighter: RangeHighlighter): HighlightInfo? {
return if (highlighter.isValid)
HighlightInfo.fromRangeHighlighter(highlighter)?.takeIf { it.severity.myVal >= MINIMUM_SEVERITY }
else
null
}
private inline fun runWithHighlighterIfValid(highlighter: RangeHighlighter, actionForImmediate: (HighlighterWithInfo) -> Unit, actionForAsync: (HighlighterWithInfo.Async) -> Unit) {
if (!highlighter.isValid) {
return
val info = getHighlightInfoIfValid(highlighter)
if (info != null) {
processHighlighterWithInfo(HighlighterWithInfo.from(highlighter, info), actionForImmediate, actionForAsync)
}
val info = HighlightInfo.fromRangeHighlighter(highlighter)
if (info == null || info.severity.myVal < MINIMUM_SEVERITY) {
return
}
processHighlighterWithInfo(HighlighterWithInfo.from(highlighter, info), actionForImmediate, actionForAsync)
}
private inline fun processHighlighterWithInfo(highlighterWithInfo: HighlighterWithInfo, actionForImmediate: (HighlighterWithInfo) -> Unit, actionForAsync: (HighlighterWithInfo.Async) -> Unit) {

View File

@ -17,6 +17,11 @@
]]></description>
<change-notes><![CDATA[
<b>Version 1.1.0</b>
<ul>
<li>Fixed showing inspections that include HTML in their description. (<a href="https://github.com/chylex/IntelliJ-Inspection-Lens/pull/3">PR #3</a> by <a href="https://github.com/KostkaBrukowa">KostkaBrukowa</a>)</li>
<li>Fixed exception when asynchronous inspections run on a non-EDT thread.
</ul>
<b>Version 1.0.0</b>
<ul>
<li>Initial version with support for IntelliJ 2022.2 and newer.</li>