ekvedaras / laravel-query-intellij

💿 Laravel Query Builder integration for PhpStorm
MIT License
47 stars 3 forks source link

endOffset must not exceed text range length #109

Open dcaswel opened 1 year ago

dcaswel commented 1 year ago

This plugin has been really helpful but I'm getting the same error coming up and PhpStorm is asking if I want to disable the plugin. I am running:

The error I'm getting is:

java.lang.Throwable: Argument rangeInElement (497,544) endOffset must not exceed descriptor text range (2645, 3188) length (543).
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
    at com.intellij.codeInspection.ProblemDescriptorBase.<init>(ProblemDescriptorBase.java:71)
    at com.intellij.codeInspection.InspectionManagerBase.createProblemDescriptor(InspectionManagerBase.java:105)
    at com.intellij.codeInspection.ProblemsHolder.registerProblem(ProblemsHolder.java:178)
    at dev.ekvedaras.laravelquery.inspection.UnknownColumnInspection$buildVisitor$1.registerProblem(UnknownColumnInspection.kt:63)
    at dev.ekvedaras.laravelquery.inspection.UnknownColumnInspection$buildVisitor$1.inspectWithThreeParts(UnknownColumnInspection.kt:116)
    at dev.ekvedaras.laravelquery.inspection.UnknownColumnInspection$buildVisitor$1.visitPhpStringLiteralExpression(UnknownColumnInspection.kt:55)
    at com.jetbrains.php.lang.psi.elements.impl.StringLiteralExpressionImpl.accept(StringLiteralExpressionImpl.java:45)
    at com.jetbrains.php.lang.psi.elements.impl.PhpPsiElementImpl.accept(PhpPsiElementImpl.java:73)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$9(InspectionRunner.java:324)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$10(InspectionRunner.java:332)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:173)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$11(InspectionRunner.java:338)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:159)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:151)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$12(InspectionRunner.java:301)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:119)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$13(InspectionRunner.java:301)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:299)
    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:60)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:284)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:272)
    at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
ekvedaras commented 1 year ago

Do you know the code that triggers this by any chance?

dcaswel commented 1 year ago

Sorry, I don't know. I get a message in the bottom corner that says there was an IDE Internal Error and when I click on that, it gives me a box that says it's the Laravel Query plugin throwing the error and gives me that stacktrace. I did disabled the plugin so I wouldn't get the error. When I saw your question, I re-enabled it so I could see if I could tell where it came from and the error came up almost immediately. I don't know if that helps at all.

ekvedaras commented 1 year ago

It wants to register an unknown column inspection message on some string, but there is something wrong with text ranges, will try to look at will be going in blind 😄