Skip to content

Commit

Permalink
feat(vcs): add notification for empty diff context
Browse files Browse the repository at this point in the history
Add a notification to inform the user when the diff context is empty or cannot provide enough useful information. This helps improve user experience and provides feedback on the status of the diff context.
  • Loading branch information
phodal committed Jan 12, 2024
1 parent be3126c commit f2382c5
Showing 1 changed file with 2 additions and 0 deletions.
@@ -1,5 +1,6 @@
package cc.unitmesh.devti.actions.vcs

import cc.unitmesh.devti.AutoDevNotifications
import cc.unitmesh.devti.actions.chat.base.ChatBaseAction
import cc.unitmesh.devti.gui.chat.ChatActionType
import cc.unitmesh.devti.llms.LlmFactory
Expand Down Expand Up @@ -35,6 +36,7 @@ class CommitMessageSuggestionAction : ChatBaseAction() {
val diffContext = project.service<VcsPrompting>().prepareContext()
if (diffContext.isEmpty() || diffContext == "\n") {
logger.warn("Diff context is empty or cannot get enough useful context.")
AutoDevNotifications.notify(project, "Diff context is empty or cannot get enough useful context.")
return
}

Expand Down

0 comments on commit f2382c5

Please sign in to comment.