mirror of
https://github.com/chylex/IntelliJ-Inspection-Lens.git
synced 2024-11-25 16:42:54 +01:00
Compare commits
3 Commits
e6be154f88
...
ce85aa130d
Author | SHA1 | Date | |
---|---|---|---|
ce85aa130d | |||
0e380a4658 | |||
fd50ca90b6 |
@ -4,11 +4,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.6.21"
|
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"
|
group = "com.chylex.intellij.inspectionlens"
|
||||||
version = "1.0.0"
|
version = "1.1.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -63,18 +63,19 @@ class LensMarkupModelListener private constructor(editor: Editor) : MarkupModelL
|
|||||||
companion object {
|
companion object {
|
||||||
private val MINIMUM_SEVERITY = HighlightSeverity.TEXT_ATTRIBUTES.myVal + 1
|
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) {
|
private inline fun runWithHighlighterIfValid(highlighter: RangeHighlighter, actionForImmediate: (HighlighterWithInfo) -> Unit, actionForAsync: (HighlighterWithInfo.Async) -> Unit) {
|
||||||
if (!highlighter.isValid) {
|
val info = getHighlightInfoIfValid(highlighter)
|
||||||
return
|
if (info != null) {
|
||||||
}
|
|
||||||
|
|
||||||
val info = HighlightInfo.fromRangeHighlighter(highlighter)
|
|
||||||
if (info == null || info.severity.myVal < MINIMUM_SEVERITY) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
processHighlighterWithInfo(HighlighterWithInfo.from(highlighter, info), actionForImmediate, actionForAsync)
|
processHighlighterWithInfo(HighlighterWithInfo.from(highlighter, info), actionForImmediate, actionForAsync)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private inline fun processHighlighterWithInfo(highlighterWithInfo: HighlighterWithInfo, actionForImmediate: (HighlighterWithInfo) -> Unit, actionForAsync: (HighlighterWithInfo.Async) -> Unit) {
|
private inline fun processHighlighterWithInfo(highlighterWithInfo: HighlighterWithInfo, actionForImmediate: (HighlighterWithInfo) -> Unit, actionForAsync: (HighlighterWithInfo.Async) -> Unit) {
|
||||||
if (highlighterWithInfo is HighlighterWithInfo.Async) {
|
if (highlighterWithInfo is HighlighterWithInfo.Async) {
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
]]></description>
|
]]></description>
|
||||||
|
|
||||||
<change-notes><![CDATA[
|
<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>
|
<b>Version 1.0.0</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Initial version with support for IntelliJ 2022.2 and newer.</li>
|
<li>Initial version with support for IntelliJ 2022.2 and newer.</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user