1
0
mirror of https://github.com/chylex/IntelliJ-Inspection-Lens.git synced 2025-05-07 08:34:06 +02:00

Fix exception when async description supplier runs on a non-EDT thread

This commit is contained in:
chylex 2022-08-16 06:41:41 +02:00
parent 10461d2927
commit cd465ebc0e
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548

View File

@ -47,7 +47,15 @@ class LensMarkupModelListener private constructor(editor: Editor) : MarkupModelL
private fun showAsynchronously(highlighterWithInfo: HighlighterWithInfo.Async) {
highlighterWithInfo.requestDescription {
if (highlighterWithInfo.highlighter.isValid && highlighterWithInfo.hasDescription) {
lens.show(highlighterWithInfo)
val application = ApplicationManager.getApplication()
if (application.isDispatchThread) {
lens.show(highlighterWithInfo)
}
else {
application.invokeLater {
lens.show(highlighterWithInfo)
}
}
}
}
}