EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.73k stars 290 forks source link

NPE in PSI #470

Closed jnellis closed 2 years ago

jnellis commented 2 years ago

Environment(环境)

name version
IDEA 2021.3.3 Ultimate
EmmyLua 1.13.6.224-IDEA213
windows 10 build 19043.1645

What are the steps to reproduce this issue?(重现步骤?)

Seems to happen when you begin to type the word 'function' and before you get to the first parenthesis. Happens other times but can't confirm if this was also the scenario.

What happens?(出现什么问题?)

IDE throws IDE Fatal Error popup and then shows the report window.

What were you expecting to happen?(期望?)

No interruptions at all.

Any logs, error output, etc?(有没有什么log, error输出?)

java.lang.NullPointerException at com.tang.intellij.lua.psi.LuaPsiImplUtilKt$getPresentation$2.getPresentableText(LuaPsiImplUtil.kt:161) at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.update(PsiElement2UsageTargetAdapter.java:279) at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.(PsiElement2UsageTargetAdapter.java:63) at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.(PsiElement2UsageTargetAdapter.java:68) at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.(PsiElement2UsageTargetAdapter.java:90) 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:139) ...

Any other comments?(其它说明)

@CppCXY

Explicit null being returned instead of maybe empty string "" or some exhaustible default "unknown" identifier. bb79688f64cb3e133b34328b13c5500ebc6bbd92

CppCXY commented 2 years ago

This has been fixed, you can download https://ci.appveyor.com/project/EmmyLua/intellij-emmylua/build/artifacts