From f2382c5d75612fd3fa78520dadff418cec623c15 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Fri, 12 Jan 2024 09:42:10 +0800 Subject: [PATCH] feat(vcs): add notification for empty diff context 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. --- .../unitmesh/devti/actions/vcs/CommitMessageSuggestionAction.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/cc/unitmesh/devti/actions/vcs/CommitMessageSuggestionAction.kt b/src/main/kotlin/cc/unitmesh/devti/actions/vcs/CommitMessageSuggestionAction.kt index 6c9fcbb0a8..400a3ef1fa 100644 --- a/src/main/kotlin/cc/unitmesh/devti/actions/vcs/CommitMessageSuggestionAction.kt +++ b/src/main/kotlin/cc/unitmesh/devti/actions/vcs/CommitMessageSuggestionAction.kt @@ -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 @@ -35,6 +36,7 @@ class CommitMessageSuggestionAction : ChatBaseAction() { val diffContext = project.service().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 }