Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot generate commit message when using a submodule #303

Open
d3qtian opened this issue Jan 8, 2025 · 2 comments
Open

Bug: cannot generate commit message when using a submodule #303

d3qtian opened this issue Jan 8, 2025 · 2 comments

Comments

@d3qtian
Copy link

d3qtian commented Jan 8, 2025

Error message:

Unhandled exception in [ComponentManager(ApplicationImpl@2039735516), com.intellij.codeWithMe.ClientIdContextElementPrecursor@6011d1ed, CoroutineName(com.github.blarc.ai.commits.intellij.plugin.settings.clients.openAi.OpenAiClientService), ModalityState.NON_MODAL, Dispatchers.Default]

com.intellij.openapi.vcs.VcsException: Cannot get content of directory: file://C:/xxx/git-repo-folder/csharp-project-folder/submodule-folder
at com.intellij.openapi.vcs.changes.CurrentContentRevision.getContentAsBytes(CurrentContentRevision.java:46)
at com.intellij.openapi.diff.impl.patch.IdeaTextPatchBuilder$BinaryAirContentRevision.getContentAsBytes(IdeaTextPatchBuilder.java:182)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.buildBinaryPatch(TextPatchBuilder.java:283)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.createPatch(TextPatchBuilder.java:88)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.build(TextPatchBuilder.java:71)
at com.intellij.openapi.diff.impl.patch.TextPatchBuilder.buildPatch(TextPatchBuilder.java:59)
at com.intellij.openapi.diff.impl.patch.IdeaTextPatchBuilder.buildPatch(IdeaTextPatchBuilder.java:111)
at com.intellij.openapi.diff.impl.patch.IdeaTextPatchBuilder.buildPatch(IdeaTextPatchBuilder.java:91)
at com.github.blarc.ai.commits.intellij.plugin.AICommitsUtils.computeDiff(AICommitsUtils.kt:123)
at com.github.blarc.ai.commits.intellij.plugin.settings.clients.LLMClientService$generateCommitMessage$1$1.invokeSuspend(LLMClientService.kt:91)
at com.github.blarc.ai.commits.intellij.plugin.settings.clients.LLMClientService$generateCommitMessage$1$1.invoke(LLMClientService.kt)
at com.github.blarc.ai.commits.intellij.plugin.settings.clients.LLMClientService$generateCommitMessage$1$1.invoke(LLMClientService.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at com.intellij.platform.util.progress.ProgressPipeImpl.collectProgressUpdates(ProgressPipe.kt:43)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternalOld$2.invokeSuspend(PlatformTaskSupport.kt:157)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternalOld$2.invoke(PlatformTaskSupport.kt)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternalOld$2.invoke(PlatformTaskSupport.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
at com.intellij.openapi.progress.impl.PlatformTaskSupport.withBackgroundProgressInternalOld(PlatformTaskSupport.kt:150)
at com.intellij.openapi.progress.impl.PlatformTaskSupport.access$withBackgroundProgressInternalOld(PlatformTaskSupport.kt:57)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invokeSuspend(PlatformTaskSupport.kt:91)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invoke(PlatformTaskSupport.kt)
at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invoke(PlatformTaskSupport.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
at com.intellij.openapi.progress.impl.PlatformTaskSupport.withBackgroundProgressInternal(PlatformTaskSupport.kt:89)
at com.intellij.platform.ide.progress.TasksKt.withBackgroundProgress(tasks.kt:56)
at com.intellij.platform.ide.progress.TasksKt.withBackgroundProgress(tasks.kt:21)
at com.github.blarc.ai.commits.intellij.plugin.settings.clients.LLMClientService$generateCommitMessage$1.invokeSuspend(LLMClientService.kt:85)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ApplicationImpl@2039735516), com.intellij.codeWithMe.ClientIdContextElementPrecursor@6011d1ed, CoroutineName(com.github.blarc.ai.commits.intellij.plugin.settings.clients.openAi.OpenAiClientService), ModalityState.NON_MODAL, StandaloneCoroutine{Cancelled}@2d46057f, Dispatchers.Default]
Caused by: java.io.IOException: Cannot get content of directory: file://C:/xxx/git-repo-folder/csharp-project-folder/submodule-folder
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.contentsToByteArray(VirtualDirectoryImpl.java:599)
at com.intellij.openapi.vcs.changes.CurrentContentRevision.getContentAsBytes(CurrentContentRevision.java:43)
... 37 more

@Blarc
Copy link
Owner

Blarc commented Jan 20, 2025

Hey @d3qtian,

I can't repeat this. Any chance you could make a repeatable repo?

@d3qtian
Copy link
Author

d3qtian commented Jan 20, 2025

I am not sure if I have enough time.
I can confirm that this error still exists when I have a parent repo that has a submodule repo and I made some changes in the submodule repo and try to generate a commit message on the parent repo.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants