lppedd / idea-conventional-commit

Context and template-based completion for conventional/semantic commits.
https://plugins.jetbrains.com/plugin/13389-conventional-commit
MIT License
336 stars 18 forks source link

com.intellij.diagnostic.PluginException: com.github.lppedd.cc.psiElement.CommitTypePsiElement cannot be presented #68

Closed gs-massil closed 2 years ago

gs-massil commented 2 years ago

I keep getting this issue with Rider, though it doesn't seem to have any impact on the behavior of the plugin.

Steps to reproduce

I'm unsure of the exact steps to reproduce, though the error appears quite often during my workday. It might be related to branch operations (checkout/merge/rebase).

Here's the stacktrace:

com.intellij.diagnostic.PluginException: com.github.lppedd.cc.psiElement.CommitTypePsiElement cannot be presented [Plugin: com.github.lppedd.idea-conventional-commit]
    at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:270)
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
    at com.intellij.codeInsight.navigation.UtilKt.presentationError(util.kt:83)
    at com.intellij.codeInsight.navigation.UtilKt.targetPresentation(util.kt:67)
    at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.getPresentation(PsiElementDocumentationTarget.kt:50)
    at com.intellij.lang.documentation.impl.ImplKt.documentationRequest(impl.kt:18)
    at com.intellij.lang.documentation.ide.impl.LookupKt$lookupElementToRequestMapper$1$1.invoke(lookup.kt:82)
    at com.intellij.lang.documentation.ide.impl.LookupKt$lookupElementToRequestMapper$1$1.invoke(lookup.kt)
    at com.intellij.openapi.progress.CancellationKt$sam$com_intellij_openapi_util_ThrowableComputable$0.compute(cancellation.kt)
    at com.intellij.openapi.progress.Cancellation.withJob(Cancellation.java:65)
    at com.intellij.openapi.progress.CancellationKt.withJob(cancellation.kt:12)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$3.run(ReadAction.kt:74)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
    at com.intellij.openapi.application.rw.ReadAction.tryReadAction(ReadAction.kt:71)
    at com.intellij.openapi.application.rw.ReadAction.access$tryReadAction(ReadAction.kt:14)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2$2.run(ReadAction.kt:62)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2.invokeSuspend(ReadAction.kt:60)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

System

JetBrains Rider 2021.3 EAP 10
Build #RD-213.5744.263, built on November 30, 2021
Runtime version: 11.0.13+7-b1751.19 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
.NET Framework 4.0.30319.42000
GC: G1 Young Generation, G1 Old Generation
Memory: 1500M
Cores: 24
Registry:
    ide.mac.bigsur.window.with.tabs.enabled=false
    rdclient.asyncActions=false
    indexing.enable.entity.provider.based.indexing=false
    ide.new.project.model.index.case.sensitivity=true
Non-Bundled Plugins:
    indent-rainbow.indent-rainbow (1.7.0)
    com.ivanovych666.intellij.plugin.jsonsorter (1.0.0-beta.3.4)
    com.intellij.resharper.HeapAllocationsViewer (2021.3.0-eap05)
    com.intellij.ideolog (203.0.27.0)
    com.godwin.json.parser (1.4.1)
    com.github.lppedd.idea-conventional-commit (0.19.0)
    com.fwdekker.randomness (2.7.3)
    cognitivecomplexity-rider (2021.3.0-eap01)
    cn.jxzhang.plugin.json-formatter (1.4)
    be.3factr.t4processor (0.6.1)
    com.jetbrains.rider.android (213.5744.263)
    String Manipulation (8.22.203.000.1)
    mobi.hsz.idea.gitignore (4.3.0)
    CMD Support (1.0.5)
lppedd commented 2 years ago

I think the platform itself introduced new interfaces to represent PsiElements in a presentable context. Looking futher it seems they reworked the entirety of the popup handling. 😭

lppedd commented 2 years ago

image Basically my PsiElements extends FakePsiElement, which does return null on every of these methods (presentableText, name, text), because it's in fact a fake element, as the containing file is a simple txt.

I will implement the element.text to return the commit token text (e.g. fix, refactor).

laggage commented 2 years ago

Got the same problem

lppedd commented 2 years ago

Sorry for the long wait. Yesterday I've pushed an update for Return Highlighter, today I'll try to push one for this.

wapenshaw commented 2 years ago

Sorry for the long wait. Yesterday I've pushed an update for Return Highlighter, today I'll try to push one for this.

hey, any updates? 😄

Same issue here

lots0logs commented 2 years ago

:sweat_smile:

bump

rafek1241 commented 2 years ago

Same problem

rayk commented 2 years ago

can report the same here

com.intellij.diagnostic.PluginException: com.github.lppedd.cc.psiElement.CommitTypePsiElement cannot be presented [Plugin: com.github.lppedd.idea-conventional-commit]
    at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:290)
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
    at com.intellij.codeInsight.navigation.UtilKt.presentationError(util.kt:83)
    at com.intellij.codeInsight.navigation.UtilKt.targetPresentation(util.kt:67)
    at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.getPresentation(PsiElementDocumentationTarget.kt:52)
    at com.intellij.lang.documentation.impl.ImplKt.documentationRequest(impl.kt:18)
    at com.intellij.lang.documentation.ide.impl.LookupKt$lookupElementToRequestMapper$1$1.invoke(lookup.kt:82)
    at com.intellij.lang.documentation.ide.impl.LookupKt$lookupElementToRequestMapper$1$1.invoke(lookup.kt)
    at com.intellij.openapi.progress.CancellationKt$sam$com_intellij_openapi_util_ThrowableComputable$0.compute(cancellation.kt)
    at com.intellij.openapi.progress.Cancellation.withJob(Cancellation.java:65)
    at com.intellij.openapi.progress.CancellationKt.withJob(cancellation.kt:12)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$3.run(ReadAction.kt:74)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
    at com.intellij.openapi.application.rw.ReadAction.tryReadAction(ReadAction.kt:71)
    at com.intellij.openapi.application.rw.ReadAction.access$tryReadAction(ReadAction.kt:14)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2$2.run(ReadAction.kt:62)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
    at com.intellij.openapi.application.rw.ReadAction$tryReadAction$2.invokeSuspend(ReadAction.kt:60)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)