lppedd / idea-conventional-commit

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

NoSuchElementException #59

Closed webcrawls closed 3 years ago

webcrawls commented 3 years ago

This is using Conventional Commit 0.18.0, downloaded in IntelliJ Zvia the plugin marketplace.

Upon first typing in the commit dialog, the IntelliJ IDE reports this error:

java.util.NoSuchElementException: Collection contains no element matching the predicate.
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider$getCommitTypes$2$1.invoke(RecentCommitTokenProvider.kt:168)
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider$getCommitTypes$2$1.invoke(RecentCommitTokenProvider.kt:23)
    at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
    at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
    at kotlin.sequences.DistinctIterator.computeNext(Sequences.kt:571)
    at kotlin.collections.AbstractIterator.tryToComputeNext(AbstractIterator.kt:42)
    at kotlin.collections.AbstractIterator.hasNext(AbstractIterator.kt:29)
    at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
    at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
    at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
    at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
    at kotlin.sequences.SequencesKt___SequencesKt.toMutableSet(_Sequences.kt:1155)
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider$getCommitTypes$2.invoke(RecentCommitTokenProvider.kt:58)
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider$getCommitTypes$2.invoke(RecentCommitTokenProvider.kt:23)
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider.doGet(RecentCommitTokenProvider.kt:120)
    at com.github.lppedd.cc.vcs.RecentCommitTokenProvider.getCommitTypes(RecentCommitTokenProvider.kt:48)
    at com.github.lppedd.cc.completion.providers.TypeCompletionProvider$complete$2$1.invoke(TypeCompletionProvider.kt:34)
    at com.github.lppedd.cc.completion.providers.TypeCompletionProvider$complete$2$1.invoke(TypeCompletionProvider.kt:18)
    at com.github.lppedd.cc.CCExtensionsKt$sam$i$java_util_concurrent_Callable$0.call(CCExtensions.kt)
    at com.intellij.openapi.application.ex.ApplicationUtil.lambda$runWithCheckCanceled$1(ApplicationUtil.java:43)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
    at com.intellij.openapi.application.ex.ApplicationUtil.lambda$runWithCheckCanceled$2(ApplicationUtil.java:41)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:265)
    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:834)

Unsure if any configuration is required (I just grabbed this from the marketplace, restarted, and started typing my commit message).

lppedd commented 3 years ago

Hi! No no, no configuration required. It's just an issue with the VCS integration that has issues with the newer releases of IDEA. Thanks for the report!

lppedd commented 3 years ago

In the meantime, try to disable com.github.lppedd.cc.providers.vcs from the Registry.

lppedd commented 3 years ago

Could you please tell me the state of the repository when you first invoked completion? Was it just created/empty? Did it have commits? This would help me understand the root cause 😄