Benjamin-Dobell / IntelliJ-Luanalysis

Type-safe Lua IDE — IntelliJ IDEA plugin
Apache License 2.0
155 stars 21 forks source link

java.lang.NullPointerException #147

Closed muescha closed 1 year ago

muescha commented 1 year ago

Environment

Name Version
IDEA version IntelliJ IDEA 2022.3.2 Preview (Ultimate Edition) Build #IU-223.8617.9, built on January 11, 2023
Luanalysis version 1.2.2-IDEA203
OS macOS Ventura 13.1 (22C65)

Preferences

(Preferences -> Languages & Frameworks > Luanalysis)

Lua

Name Setting
Language level Lua 5.4

Type Safety

Name Setting
Strict nil checks
Unknown type (any) is indexable ☑️
Unknown type (any) is callabale ☑️

What are the steps to reproduce this issue?

  1. n/a

What happens?

i see this error report from IDEA

What were you expecting to happen?

Any logs, error output, etc?

java.lang.NullPointerException
    at com.tang.intellij.lua.psi.LuaPsiImplUtilKt$getPresentation$2.getPresentableText(LuaPsiImplUtil.kt:180)
    at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.update(PsiElement2UsageTargetAdapter.java:252)
    at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.<init>(PsiElement2UsageTargetAdapter.java:59)
    at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.<init>(PsiElement2UsageTargetAdapter.java:64)
    at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.<init>(PsiElement2UsageTargetAdapter.java:74)
    at com.intellij.find.findUsages.DefaultUsageTargetProvider.getTargets(DefaultUsageTargetProvider.java:17)
    at com.intellij.usages.UsageTargetUtil.findUsageTargets(UsageTargetUtil.java:51)
    at com.intellij.usages.UsageTargetUtil.findUsageTargets(UsageTargetUtil.java:32)
    at com.intellij.ide.impl.dataRules.UsageTargetsRule.getData(UsageTargetsRule.java:13)
    at com.intellij.ide.impl.DataManagerImpl.getRulesData(DataManagerImpl.java:210)
    at com.intellij.ide.impl.DataManagerImpl.lambda$getDataRuleInner$8(DataManagerImpl.java:183)
    at com.intellij.ide.impl.DataManagerImpl.getDataFromRuleInner(DataManagerImpl.java:112)
    at com.intellij.ide.impl.DataManagerImpl.getDataFromRulesInner(DataManagerImpl.java:99)
    at com.intellij.ide.impl.DataManagerImpl.getDataFromRules(DataManagerImpl.java:67)
    at com.intellij.openapi.actionSystem.impl.PreCachedDataContext.getDataInner(PreCachedDataContext.java:224)
    at com.intellij.openapi.actionSystem.impl.PreCachedDataContext.getData(PreCachedDataContext.java:166)
    at com.intellij.openapi.actionSystem.DataContext.getData(DataContext.java:42)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$ensureSlowDataKeysPreCached$20(ActionUpdater.java:471)
    at com.intellij.diagnostic.telemetry.TraceKt.runWithSpan(trace.kt:74)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.ensureSlowDataKeysPreCached(ActionUpdater.java:466)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$callAction$6(ActionUpdater.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:201)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:161)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:137)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:124)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:705)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:556)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$23(ActionUpdater.java:529)
    at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1406)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:529)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:606)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$23(ActionUpdater.java:529)
    at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1406)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:529)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:309)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$14(ActionUpdater.java:377)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$15(ActionUpdater.java:396)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$tryRunReadActionAndCancelBeforeWrite$19(ActionUpdater.java:428)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:128)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.tryRunReadActionAndCancelBeforeWrite(ActionUpdater.java:424)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$16(ActionUpdater.java:396)
    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:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$17(ActionUpdater.java:395)
    at io.opentelemetry.context.Context.lambda$wrap$1(Context.java:212)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:243)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:29)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:216)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:205)
    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)

Any other comments?

Benjamin-Dobell commented 1 year ago

Duplicate of https://github.com/Benjamin-Dobell/IntelliJ-Luanalysis/issues/94.

I actually tracked this down recently but caught up fixing some other stuff. When 1.4.1 is released, this should be fixed.

Speaking of which, you're on 1.2.2 still, definitely give 1.4.0 a try. Has a lot of fixes... and hopefully a lot less regressions 😅

muescha commented 1 year ago

oh i will try the new version 👍 - 1.2.2 is very old - i did not get an notification about new plugin updates