detekt / detekt-intellij-plugin

detekt plugin for IntelliJ
https://plugins.jetbrains.com/plugin/10761-detekt
Apache License 2.0
299 stars 39 forks source link

Annotation range error on IntelliJ 2024.2.3 #520

Open ajyoon opened 1 month ago

ajyoon commented 1 month ago

This error occurred when opening a file on the latest IntelliJ. It doesn't seem to always occur; I've been editing Kotlin code on the latest IntelliJ for about 15 minutes with no issues, and this error only appeared after some time, shortly upon opening a Kotlin file in my project.

ExternalToolPass: 

com.intellij.diagnostic.PluginException: annotator: io.gitlab.arturbosch.detekt.idea.DetektAnnotator@4d214369 (class io.gitlab.arturbosch.detekt.idea.DetektAnnotator) [Plugin: detekt]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.processError(ExternalToolPass.java:268)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:241)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:231)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$1(ExternalToolPass.java:174)
    at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:54)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:264)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:221)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:857)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:66)
    at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:171)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:168)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:366)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:356)
    at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:313)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:295)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:262)
    at com.intellij.util.Alarm$Request.lambda$runSafely$0(Alarm.java:371)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
    at com.intellij.util.Alarm$Request.lambda$runSafely$1(Alarm.java:369)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:255)
    at com.intellij.util.Alarm$Request.runSafely(Alarm.java:368)
    at com.intellij.util.Alarm$Request.run(Alarm.java:356)
    at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:383)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:212)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.intellij.diagnostic.PluginException: Range must be inside element being annotated: (0,1740); but got: (1740,1741) [Plugin: detekt]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
    at com.intellij.codeInsight.daemon.impl.B.range(B.java:193)
    at io.gitlab.arturbosch.detekt.idea.DetektAnnotator.apply(DetektAnnotator.kt:64)
    at io.gitlab.arturbosch.detekt.idea.DetektAnnotator.apply(DetektAnnotator.kt:20)
    at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.applyExternalAnnotatorWithContext(AnnotationHolderImpl.java:233)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:238)
    ... 48 more