Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginException: Range must be inside element being annotated #1087

Closed
gastaldi opened this issue Aug 9, 2023 · 5 comments · Fixed by #1109
Closed

PluginException: Range must be inside element being annotated #1087

gastaldi opened this issue Aug 9, 2023 · 5 comments · Fixed by #1109
Assignees
Labels
bug Something isn't working lsp4ij LSP client for IJ validation
Milestone

Comments

@gastaldi
Copy link
Contributor

gastaldi commented Aug 9, 2023

While using 1.24.0, I got this exception while editing an application.properties in a Quarkus project (https://github.com/quarkusio/registry.quarkus.io). This happened once, so I don't have a way to reproduce it:

   ExternalToolPass: 
   
   com.intellij.diagnostic.PluginException: annotator: com.redhat.devtools.intellij.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator@66f121b (class com.redhat.devtools.intellij.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator) [Plugin: com.redhat.devtools.intellij.quarkus]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.processError(ExternalToolPass.java:251)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:227)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:216)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$1(ExternalToolPass.java:168)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:64)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:63)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:165)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:360)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:162)
	at com.intellij.util.ui.update.Update.runUpdate(Update.java:114)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:348)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:338)
	at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:295)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:277)
	at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:254)
	at com.intellij.util.Alarm$Request.runSafely(Alarm.java:373)
	at com.intellij.util.Alarm$Request.run(Alarm.java:360)
	at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:328)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	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:31)
	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:215)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.intellij.diagnostic.PluginException: Range must be inside element being annotated: (0,2560); but got: (2553,2561) [Plugin: com.redhat.devtools.intellij.quarkus]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89)
	at com.intellij.codeInsight.daemon.impl.B.range(B.java:176)
	at com.redhat.devtools.intellij.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator.createAnnotation(LSPDiagnosticAnnotator.java:88)
	at com.redhat.devtools.intellij.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator.apply(LSPDiagnosticAnnotator.java:70)
	at com.redhat.devtools.intellij.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator.apply(LSPDiagnosticAnnotator.java:41)
	at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.applyExternalAnnotatorWithContext(AnnotationHolderImpl.java:253)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doApply(ExternalToolPass.java:224)
	... 40 more
@angelozerr
Copy link
Contributor

Could you share your application.prorties please and better your project?

@gastaldi
Copy link
Contributor Author

gastaldi commented Aug 9, 2023

@angelozerr That happened while I was editing the application.properties in https://github.com/quarkusio/registry.quarkus.io

@fbricon
Copy link
Contributor

fbricon commented Aug 11, 2023

@gastaldi I can't reproduce on registry.quarkus.io. Can you reproduce this issue consistantly?

@gastaldi
Copy link
Contributor Author

Not consistanly, no. Not sure if a race condition causes that

@angelozerr
Copy link
Contributor

My supposition is that it is a diagnostic which is published but which is out of dated. We need check the range when we create IJ annotation and my PR #1101 should cancel publish disagnostics if there are too many publish for the same file.

@fbricon fbricon added bug Something isn't working lsp4ij LSP client for IJ validation labels Aug 11, 2023
@angelozerr angelozerr self-assigned this Aug 11, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Aug 11, 2023
@angelozerr angelozerr added this to the 1.25.0 milestone Aug 11, 2023
@angelozerr angelozerr moved this to ✅ Done in IDE Cloudaptors Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp4ij LSP client for IJ validation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants