tuchg / ChinesePinyin-CodeCompletionHelper

让你的 JetBrains 系 IDE ( IDEA ,PyCharm,PhpStorm,WebStorm,AndroidStudio,GoLand等 )支持中文标识符以拼音/五笔等输入方式完成代码补全,享受和英文环境一致的中文智能编码体验,为代码表达提供更多选择,一种值得考虑的折中解决方案📏
https://plugins.jetbrains.com/plugin/14838
MIT License
1.59k stars 44 forks source link

【Bug】空指针异常 #65

Closed sxin0 closed 2 years ago

sxin0 commented 2 years ago

请事先检查下列事项

编程语言

PHP

预期表现

不报错

当前表现

偶尔会报错,不好复现

可能的解决方案

重现错误场景

提供代码片段或截图 image

java.lang.NullPointerException
    at com.github.tuchg.nonasciicodecompletionhelper.completion.contributors.ChineseCompletionContributor$renderElementHandle$1.invoke(ChineseCompletionContributor.kt:69)
    at com.github.tuchg.nonasciicodecompletionhelper.completion.contributors.ChineseCompletionContributor$renderElementHandle$1.invoke(ChineseCompletionContributor.kt:63)
    at com.github.tuchg.nonasciicodecompletionhelper.completion.contributors.ChineseCompletionContributor.fillCompletionVariants$lambda-2(ChineseCompletionContributor.kt:53)
    at com.intellij.codeInsight.completion.CompletionResultSet$1.consume(CompletionResultSet.java:167)
    at com.intellij.codeInsight.completion.CompletionResultSet$1.consume(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.passResult(CompletionResultSet.java:57)
    at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.lambda$addCompletions$0(LiveTemplateCompletionContributor.java:90)
    at com.intellij.codeInsight.completion.CompletionResultSet$1.consume(CompletionResultSet.java:167)
    at com.intellij.codeInsight.completion.CompletionResultSet$1.consume(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.passResult(CompletionResultSet.java:57)
    at com.intellij.codeInsight.completion.BaseCompletionService$BaseCompletionResultSet.addElement(BaseCompletionService.java:119)
    at com.jetbrains.php.completion.PhpCompletionSorting$DelegateCompletionResultSetWrapper.addElement(PhpCompletionSorting.java:677)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpClassRefCompletionProvider.addLookupElement(PhpCompletionContributor.java:1115)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpClassRefCompletionProvider.lambda$addClassesContextAware$1(PhpCompletionContributor.java:983)
    at com.jetbrains.php.completion.PhpCompletionUtil$LimitedProcessor.process(PhpCompletionUtil.java:364)
    at com.intellij.util.containers.ContainerUtil.process(ContainerUtil.java:789)
    at com.jetbrains.php.completion.PhpCompletionUtil.addClassEntries(PhpCompletionUtil.java:397)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpClassRefCompletionProvider.addVariants(PhpCompletionContributor.java:1010)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpClassRefCompletionProvider.addClassesContextAware(PhpCompletionContributor.java:983)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpClassRefCompletionProvider.addCompletions(PhpCompletionContributor.java:940)
    at com.jetbrains.php.completion.PhpCompletionContributor$PhpGlobalCompletionProviderFacade.addCompletions(PhpCompletionContributor.java:507)
    at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:34)
    at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:156)
    at com.jetbrains.php.completion.PhpCompletionContributor.fillCompletionVariants(PhpCompletionContributor.java:461)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:77)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
    at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:89)
    at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:34)
    at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:156)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:77)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
    at com.github.tuchg.nonasciicodecompletionhelper.completion.contributors.ChineseCompletionContributor.fillCompletionVariants(ChineseCompletionContributor.kt:41)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:77)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:60)
    at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:133)
    at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.java:41)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.lambda$calculateItems$12(CompletionProgressIndicator.java:863)
    at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:163)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
    at com.intellij.util.indexing.FileBasedIndexEx.ignoreDumbMode(FileBasedIndexEx.java:588)
    at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:162)
    at com.intellij.util.indexing.DumbModeAccessType.ignoreDumbMode(DumbModeAccessType.java:43)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:859)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:847)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$6(CodeCompletionHandlerBase.java:353)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$tryReadOrCancel$5(CompletionThreading.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1078)
    at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:170)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:345)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$0(CompletionThreading.java:95)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)

使用环境

win11