@@ -14,9 +14,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
14
14
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
15
15
import { IQuickInputService , IQuickPickItem } from 'vs/platform/quickinput/common/quickInput' ;
16
16
import { ViewAction } from 'vs/workbench/browser/parts/views/viewPane' ;
17
- import { ActiveEditorContext } from 'vs/workbench/common/contextkeys' ;
18
17
import { runAccessibilityHelpAction } from 'vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp' ;
19
- import { clearChatEditor , clearChatSession } from 'vs/workbench/contrib/chat/browser/actions/chatClear' ;
20
18
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat' ;
21
19
import { IChatEditorOptions } from 'vs/workbench/contrib/chat/browser/chatEditor' ;
22
20
import { ChatEditorInput } from 'vs/workbench/contrib/chat/browser/chatEditorInput' ;
@@ -53,36 +51,6 @@ export function registerChatActions() {
53
51
}
54
52
} ) ;
55
53
56
- registerAction2 ( class ClearEditorAction extends Action2 {
57
- constructor ( ) {
58
- super ( {
59
- id : 'workbench.action.chatEditor.clear' ,
60
- title : {
61
- value : localize ( 'interactiveSession.clear.label' , "Clear" ) ,
62
- original : 'Clear'
63
- } ,
64
- icon : Codicon . clearAll ,
65
- f1 : false ,
66
- menu : [ {
67
- id : MenuId . EditorTitle ,
68
- group : 'navigation' ,
69
- order : 0 ,
70
- when : ActiveEditorContext . isEqualTo ( ChatEditorInput . EditorID ) ,
71
- } ]
72
- } ) ;
73
- }
74
- async run ( accessor : ServicesAccessor , ...args : any [ ] ) {
75
- const widgetService = accessor . get ( IChatWidgetService ) ;
76
-
77
- const widget = widgetService . lastFocusedWidget ;
78
- if ( ! widget ) {
79
- return ;
80
- }
81
-
82
- await clearChatEditor ( accessor , widget ) ;
83
- }
84
- } ) ;
85
-
86
54
registerAction2 ( class ClearChatHistoryAction extends Action2 {
87
55
constructor ( ) {
88
56
super ( {
@@ -165,38 +133,6 @@ export function registerChatActions() {
165
133
widgetService . lastFocusedWidget ?. focusInput ( ) ;
166
134
}
167
135
} ) ;
168
-
169
- registerAction2 ( class GlobalClearChatAction extends Action2 {
170
- constructor ( ) {
171
- super ( {
172
- id : `workbench.action.chat.clear` ,
173
- title : {
174
- value : localize ( 'interactiveSession.clear.label' , "Clear" ) ,
175
- original : 'Clear'
176
- } ,
177
- category : CHAT_CATEGORY ,
178
- icon : Codicon . clearAll ,
179
- precondition : CONTEXT_PROVIDER_EXISTS ,
180
- f1 : true ,
181
- keybinding : {
182
- weight : KeybindingWeight . WorkbenchContrib ,
183
- primary : KeyMod . WinCtrl | KeyCode . KeyL ,
184
- when : CONTEXT_IN_CHAT_SESSION
185
- }
186
- } ) ;
187
- }
188
-
189
- async run ( accessor : ServicesAccessor , ...args : any [ ] ) {
190
- const widgetService = accessor . get ( IChatWidgetService ) ;
191
-
192
- const widget = widgetService . lastFocusedWidget ;
193
- if ( ! widget ) {
194
- return ;
195
- }
196
-
197
- await clearChatSession ( accessor , widget ) ;
198
- }
199
- } ) ;
200
136
}
201
137
202
138
export function getOpenChatEditorAction ( id : string , label : string , when ?: string ) {
@@ -218,36 +154,6 @@ export function getOpenChatEditorAction(id: string, label: string, when?: string
218
154
} ;
219
155
}
220
156
221
- const getClearChatActionDescriptorForViewTitle = ( viewId : string , providerId : string ) : Readonly < IAction2Options > & { viewId : string } => ( {
222
- viewId,
223
- id : `workbench.action.chat.${ providerId } .clear` ,
224
- title : {
225
- value : localize ( 'interactiveSession.clear.label' , "Clear" ) ,
226
- original : 'Clear'
227
- } ,
228
- menu : {
229
- id : MenuId . ViewTitle ,
230
- when : ContextKeyExpr . equals ( 'view' , viewId ) ,
231
- group : 'navigation' ,
232
- order : 0
233
- } ,
234
- category : CHAT_CATEGORY ,
235
- icon : Codicon . clearAll ,
236
- f1 : false
237
- } ) ;
238
-
239
- export function getClearAction ( viewId : string , providerId : string ) {
240
- return class ClearAction extends ViewAction < ChatViewPane > {
241
- constructor ( ) {
242
- super ( getClearChatActionDescriptorForViewTitle ( viewId , providerId ) ) ;
243
- }
244
-
245
- async runInView ( accessor : ServicesAccessor , view : ChatViewPane ) {
246
- await view . clear ( ) ;
247
- }
248
- } ;
249
- }
250
-
251
157
const getHistoryChatActionDescriptorForViewTitle = ( viewId : string , providerId : string ) : Readonly < IAction2Options > & { viewId : string } => ( {
252
158
viewId,
253
159
id : `workbench.action.chat.${ providerId } .history` ,
0 commit comments