@@ -2,13 +2,15 @@ import * as vscode from 'vscode'
22import {
33 LAST_APPLIED_CHANGES_EDITOR_STATE_STATE_KEY ,
44 LAST_APPLIED_CHANGES_STATE_KEY ,
5- LAST_APPLIED_CLIPBOARD_CONTENT_STATE_KEY
5+ LAST_APPLIED_CLIPBOARD_CONTENT_STATE_KEY ,
6+ LAST_APPLIED_RAW_INSTRUCTIONS_STATE_KEY
67} from '@/constants/state-keys'
78import { dictionary } from '@shared/constants/dictionary'
89import { t } from '@/i18n'
910import { PromptViewProvider } from '@/views/prompt/backend/prompt-view-provider'
1011import { OriginalFileState } from '@/commands/apply-response-command/types/original-file-state'
1112import { undo_files } from '@/commands/apply-response-command/utils/file-operations'
13+ import { CommitMessageDetails } from '@/utils/commit-message-details'
1214
1315export const handle_undo = async (
1416 prompt_view_provider : PromptViewProvider
@@ -24,6 +26,9 @@ export const handle_undo = async (
2426 }
2527 | undefined
2628 > ( LAST_APPLIED_CHANGES_EDITOR_STATE_STATE_KEY )
29+ const raw_instructions = extension_context . workspaceState . get <
30+ string | undefined
31+ > ( LAST_APPLIED_RAW_INSTRUCTIONS_STATE_KEY )
2732
2833 if ( ! original_states || original_states . length == 0 ) {
2934 vscode . window . showInformationMessage (
@@ -39,6 +44,13 @@ export const handle_undo = async (
3944 return
4045 }
4146
47+ if ( raw_instructions ) {
48+ CommitMessageDetails . remove ( {
49+ extension_context,
50+ prompt : raw_instructions
51+ } )
52+ }
53+
4254 if ( editor_state ) {
4355 try {
4456 const uri = vscode . Uri . file ( editor_state . file_path )
@@ -72,6 +84,10 @@ export const handle_undo = async (
7284 LAST_APPLIED_CLIPBOARD_CONTENT_STATE_KEY ,
7385 null
7486 )
87+ extension_context . workspaceState . update (
88+ LAST_APPLIED_RAW_INSTRUCTIONS_STATE_KEY ,
89+ null
90+ )
7591 prompt_view_provider . set_undo_button_state ( false )
7692 prompt_view_provider . send_message ( {
7793 command : 'SHOW_AUTO_CLOSING_MODAL' ,
0 commit comments