Skip to content

Commit

Permalink
Fix SlowOperationsException
Browse files Browse the repository at this point in the history
  • Loading branch information
sxhya committed Oct 18, 2024
1 parent 7888cb2 commit 70d503c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/kotlin/org/arend/highlight/BasePass.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ abstract class BasePass(protected open val file: IArendFile, editor: Editor, nam
override fun applyInformationWithProgress() {
val errorService = myProject.service<ErrorService>()

for (error in errorList) {
val list = error.cause?.let { it as? Collection<*> ?: listOf(it) } ?: return
for (cause in list) {
val psi = getCauseElement(cause)
if (psi != null && psi.isValid) {
reportToEditor(error, psi)
errorService.report(ArendError(error, runReadAction { SmartPointerManager.createPointer(psi) }))
ApplicationManager.getApplication().invokeLater({
for (error in errorList) {
val list = error.cause?.let { it as? Collection<*> ?: listOf(it) } ?: return@invokeLater
for (cause in list) {
val psi = getCauseElement(cause)
if (psi != null && psi.isValid) {
reportToEditor(error, psi)
errorService.report(ArendError(error, runReadAction { SmartPointerManager.createPointer(psi) }))
}
}
}
}

ApplicationManager.getApplication().invokeLater({
if (isValid) {
UpdateHighlightersUtil.setHighlightersToEditor(myProject, document, textRange.startOffset, textRange.endOffset, highlights, colorsScheme, id)
}
Expand Down

0 comments on commit 70d503c

Please sign in to comment.