@codingame/monaco-vscode-chat-service-override 11.1.1 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +64 -1
  3. package/package.json +32 -13
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
  54. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
  57. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
  58. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
  60. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
  64. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
  67. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
  70. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
  71. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
  72. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
  73. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
  74. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
  75. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
  76. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
  77. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
  78. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
  79. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
  80. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
  81. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
  82. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
  83. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
  85. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
  86. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
  87. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
  88. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
  89. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
  90. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
  91. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
  92. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
  93. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
  94. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
  95. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
  96. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
  97. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
  98. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
  99. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
  100. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
  101. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
  102. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
  103. package/chat.js +0 -59
  104. package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
  109. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
  110. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -172
@@ -1,23 +1,25 @@
1
+
1
2
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
3
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
2
4
  import { localize2, localize } from 'vscode/vscode/vs/nls';
3
5
  import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
4
6
  import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
5
7
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
6
8
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
7
9
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
10
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
8
11
  import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
9
12
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
10
13
  import { isChatViewTitleActionContext } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatActions';
11
14
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
12
- import { CONTEXT_CHAT_ENABLED, CONTEXT_CHAT_LOCATION, CONTEXT_IN_CHAT_SESSION, CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED, CONTEXT_CHAT_EDITING_CAN_UNDO, CONTEXT_CHAT_EDITING_CAN_REDO } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
13
- import { hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatEditingService';
15
+ import { ChatContextKeys } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
16
+ import { WorkingSetEntryState, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService';
14
17
  import { IChatEditingService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
15
- import { CHAT_VIEW_ID, EDITS_VIEW_ID } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/chat';
18
+ import { ChatViewId, EditsViewId } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat';
16
19
  import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
17
- import { ChatEditorInput } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
18
- import '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
19
- import { clearChatEditor } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/actions/chatClear';
20
- import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
20
+ import { ChatEditorInput } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
21
+ import { CHAT_CATEGORY } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
22
+ import { clearChatEditor } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/actions/chatClear';
21
23
 
22
24
  const ACTION_ID_NEW_CHAT = `workbench.action.chat.newChat`;
23
25
  const ACTION_ID_NEW_EDIT_SESSION = `workbench.action.chat.newEditSession`;
@@ -26,15 +28,15 @@ function registerNewChatActions() {
26
28
  constructor() {
27
29
  super({
28
30
  id: 'workbench.action.chatEditor.newChat',
29
- title: ( localize2(7504, "New Chat")),
31
+ title: ( localize2(4177, "New Chat")),
30
32
  icon: Codicon.plus,
31
33
  f1: false,
32
- precondition: CONTEXT_CHAT_ENABLED,
34
+ precondition: ChatContextKeys.enabled,
33
35
  menu: [{
34
36
  id: MenuId.EditorTitle,
35
37
  group: 'navigation',
36
38
  order: 0,
37
- when: ( (ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID))),
39
+ when: ( ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
38
40
  }]
39
41
  });
40
42
  }
@@ -47,21 +49,18 @@ function registerNewChatActions() {
47
49
  constructor() {
48
50
  super({
49
51
  id: ACTION_ID_NEW_CHAT,
50
- title: ( localize2(7504, "New Chat")),
52
+ title: ( localize2(4177, "New Chat")),
51
53
  category: CHAT_CATEGORY,
52
54
  icon: Codicon.plus,
53
- precondition: ( (ContextKeyExpr.and(
54
- CONTEXT_CHAT_ENABLED,
55
- (CONTEXT_CHAT_LOCATION.notEqualsTo(ChatAgentLocation.EditingSession))
56
- ))),
55
+ precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ChatContextKeys.location.notEqualsTo(ChatAgentLocation.EditingSession)))),
57
56
  f1: true,
58
57
  keybinding: {
59
- weight: 200 ,
60
- primary: 2048 | 42 ,
58
+ weight: KeybindingWeight.WorkbenchContrib,
59
+ primary: KeyMod.CtrlCmd | KeyCode.KeyL,
61
60
  mac: {
62
- primary: 256 | 42
61
+ primary: KeyMod.WinCtrl | KeyCode.KeyL
63
62
  },
64
- when: CONTEXT_IN_CHAT_SESSION
63
+ when: ChatContextKeys.inChatSession
65
64
  },
66
65
  menu: [{
67
66
  id: MenuId.ChatContext,
@@ -69,7 +68,7 @@ function registerNewChatActions() {
69
68
  },
70
69
  {
71
70
  id: MenuId.ViewTitle,
72
- when: ( (ContextKeyExpr.equals('view', CHAT_VIEW_ID))),
71
+ when: ( ContextKeyExpr.equals('view', ChatViewId)),
73
72
  group: 'navigation',
74
73
  order: -1
75
74
  }]
@@ -94,10 +93,10 @@ function registerNewChatActions() {
94
93
  constructor() {
95
94
  super({
96
95
  id: ACTION_ID_NEW_EDIT_SESSION,
97
- title: ( localize2(7505, "New Edit Session")),
96
+ title: ( localize2(4178, "New Edit Session")),
98
97
  category: CHAT_CATEGORY,
99
98
  icon: Codicon.plus,
100
- precondition: ( (ContextKeyExpr.and(CONTEXT_CHAT_ENABLED, CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED))),
99
+ precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ChatContextKeys.editingParticipantRegistered)),
101
100
  f1: true,
102
101
  menu: [{
103
102
  id: MenuId.ChatContext,
@@ -105,11 +104,18 @@ function registerNewChatActions() {
105
104
  },
106
105
  {
107
106
  id: MenuId.ViewTitle,
108
- when: ( (ContextKeyExpr.equals('view', EDITS_VIEW_ID))),
107
+ when: ( ContextKeyExpr.equals('view', EditsViewId)),
109
108
  group: 'navigation',
110
109
  order: -1
110
+ }],
111
+ keybinding: {
112
+ weight: KeybindingWeight.WorkbenchContrib,
113
+ primary: KeyMod.CtrlCmd | KeyCode.KeyL,
114
+ mac: {
115
+ primary: KeyMod.WinCtrl | KeyCode.KeyL
111
116
  },
112
- ]
117
+ when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession))))
118
+ }
113
119
  });
114
120
  }
115
121
  async _handleCurrentEditingSession(chatEditingService, dialogService) {
@@ -117,29 +123,29 @@ function registerNewChatActions() {
117
123
  const currentEdits = currentEditingSession?.entries.get();
118
124
  const currentEditCount = currentEdits?.length;
119
125
  if (currentEditingSession && currentEditCount) {
120
- const undecidedEdits = currentEdits.filter((edit) => edit.state.get() === 0 );
126
+ const undecidedEdits = currentEdits.filter((edit) => edit.state.get() === WorkingSetEntryState.Modified);
121
127
  if (undecidedEdits.length) {
122
128
  const { result } = await dialogService.prompt({
123
- title: ( localize(7506, "Start new editing session?")),
129
+ title: ( localize(4179, "Start new editing session?")),
124
130
  message: ( localize(
125
- 7507,
126
- "Starting a new editing session will end your current session. Do you want to discard pending edits to {0} files?",
131
+ 4180,
132
+ "Starting a new editing session will end your current session. Do you want to accept pending edits to {0} files?",
127
133
  undecidedEdits.length
128
134
  )),
129
135
  type: 'info',
130
136
  cancelButton: true,
131
137
  buttons: [
132
138
  {
133
- label: ( localize(7508, "Discard & Continue")),
139
+ label: ( localize(4181, "Accept & Continue")),
134
140
  run: async () => {
135
- await currentEditingSession.reject();
141
+ await currentEditingSession.accept();
136
142
  return true;
137
143
  }
138
144
  },
139
145
  {
140
- label: ( localize(7509, "Accept & Continue")),
146
+ label: ( localize(4182, "Discard & Continue")),
141
147
  run: async () => {
142
- await currentEditingSession.accept();
148
+ await currentEditingSession.reject();
143
149
  return true;
144
150
  }
145
151
  }
@@ -164,17 +170,17 @@ function registerNewChatActions() {
164
170
  announceChatCleared(accessibilitySignalService);
165
171
  const widget = widgetService.getWidgetBySessionId(context.sessionId);
166
172
  if (widget) {
167
- chatEditingService.currentEditingSessionObs.get()?.stop();
173
+ chatEditingService.currentEditingSessionObs.get()?.stop(true);
168
174
  widget.clear();
169
175
  widget.attachmentModel.clear();
170
176
  widget.focusInput();
171
177
  }
172
178
  }
173
179
  else {
174
- const chatView = await viewsService.openView(EDITS_VIEW_ID);
180
+ const chatView = await viewsService.openView(EditsViewId);
175
181
  const widget = chatView.widget;
176
182
  announceChatCleared(accessibilitySignalService);
177
- chatEditingService.currentEditingSessionObs.get()?.stop();
183
+ chatEditingService.currentEditingSessionObs.get()?.stop(true);
178
184
  widget.clear();
179
185
  widget.attachmentModel.clear();
180
186
  widget.focusInput();
@@ -185,18 +191,13 @@ function registerNewChatActions() {
185
191
  constructor() {
186
192
  super({
187
193
  id: 'workbench.action.chat.done',
188
- title: ( localize2(7510, "Done")),
194
+ title: ( localize2(4183, "Done")),
189
195
  category: CHAT_CATEGORY,
190
- precondition: ( (ContextKeyExpr.and(CONTEXT_CHAT_ENABLED, CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED))),
196
+ precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ChatContextKeys.editingParticipantRegistered)),
191
197
  f1: false,
192
198
  menu: [{
193
199
  id: MenuId.ChatEditingWidgetToolbar,
194
- when: ( (ContextKeyExpr.and(
195
- (hasUndecidedChatEditingResourceContextKey.negate()),
196
- hasAppliedChatEditsContextKey,
197
- CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED,
198
- (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.EditingSession))
199
- ))),
200
+ when: ( ContextKeyExpr.and(( hasUndecidedChatEditingResourceContextKey.negate()), hasAppliedChatEditsContextKey, ChatContextKeys.editingParticipantRegistered, ( ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession)))),
200
201
  group: 'navigation',
201
202
  order: 0
202
203
  }]
@@ -217,7 +218,7 @@ function registerNewChatActions() {
217
218
  }
218
219
  else {
219
220
  const viewsService = accessor.get(IViewsService);
220
- const chatView = await viewsService.openView(EDITS_VIEW_ID);
221
+ const chatView = await viewsService.openView(EditsViewId);
221
222
  const widget = chatView.widget;
222
223
  announceChatCleared(accessibilitySignalService);
223
224
  widget.clear();
@@ -230,18 +231,18 @@ function registerNewChatActions() {
230
231
  constructor() {
231
232
  super({
232
233
  id: 'workbench.action.chat.undoEdit',
233
- title: ( localize2(7511, "Undo Last Edit")),
234
+ title: ( localize2(4184, "Undo Last Edit")),
234
235
  category: CHAT_CATEGORY,
235
236
  icon: Codicon.discard,
236
- precondition: ( (ContextKeyExpr.and(
237
- CONTEXT_CHAT_EDITING_CAN_UNDO,
238
- CONTEXT_CHAT_ENABLED,
239
- CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED
240
- ))),
237
+ precondition: ( ContextKeyExpr.and(
238
+ ChatContextKeys.chatEditingCanUndo,
239
+ ChatContextKeys.enabled,
240
+ ChatContextKeys.editingParticipantRegistered
241
+ )),
241
242
  f1: true,
242
243
  menu: [{
243
244
  id: MenuId.ViewTitle,
244
- when: ( (ContextKeyExpr.equals('view', EDITS_VIEW_ID))),
245
+ when: ( ContextKeyExpr.equals('view', EditsViewId)),
245
246
  group: 'navigation',
246
247
  order: -3
247
248
  }]
@@ -249,32 +250,29 @@ function registerNewChatActions() {
249
250
  }
250
251
  async run(accessor, ...args) {
251
252
  const chatEditingService = accessor.get(IChatEditingService);
252
- const chatWidgetService = accessor.get(IChatWidgetService);
253
253
  const currentEditingSession = chatEditingService.currentEditingSession;
254
254
  if (!currentEditingSession) {
255
255
  return;
256
256
  }
257
- const widget = chatWidgetService.getWidgetBySessionId(currentEditingSession.chatSessionId);
258
257
  await currentEditingSession.undoInteraction();
259
- widget?.viewModel?.model.disableRequests(currentEditingSession.hiddenRequestIds.get());
260
258
  }
261
259
  });
262
260
  registerAction2(class RedoChatEditInteractionAction extends Action2 {
263
261
  constructor() {
264
262
  super({
265
263
  id: 'workbench.action.chat.redoEdit',
266
- title: ( localize2(7512, "Redo Last Edit")),
264
+ title: ( localize2(4185, "Redo Last Edit")),
267
265
  category: CHAT_CATEGORY,
268
266
  icon: Codicon.redo,
269
- precondition: ( (ContextKeyExpr.and(
270
- CONTEXT_CHAT_EDITING_CAN_REDO,
271
- CONTEXT_CHAT_ENABLED,
272
- CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED
273
- ))),
267
+ precondition: ( ContextKeyExpr.and(
268
+ ChatContextKeys.chatEditingCanRedo,
269
+ ChatContextKeys.enabled,
270
+ ChatContextKeys.editingParticipantRegistered
271
+ )),
274
272
  f1: true,
275
273
  menu: [{
276
274
  id: MenuId.ViewTitle,
277
- when: ( (ContextKeyExpr.equals('view', EDITS_VIEW_ID))),
275
+ when: ( ContextKeyExpr.equals('view', EditsViewId)),
278
276
  group: 'navigation',
279
277
  order: -2
280
278
  }]
@@ -282,55 +280,49 @@ function registerNewChatActions() {
282
280
  }
283
281
  async run(accessor, ...args) {
284
282
  const chatEditingService = accessor.get(IChatEditingService);
285
- const chatWidgetService = accessor.get(IChatWidgetService);
286
283
  const currentEditingSession = chatEditingService.currentEditingSession;
287
284
  if (!currentEditingSession) {
288
285
  return;
289
286
  }
290
- const widget = chatWidgetService.getWidgetBySessionId(currentEditingSession.chatSessionId);
291
287
  await chatEditingService.currentEditingSession?.redoInteraction();
292
- widget?.viewModel?.model.disableRequests(currentEditingSession.hiddenRequestIds.get());
293
288
  }
294
289
  });
295
290
  registerAction2(class GlobalOpenEditsAction extends Action2 {
296
291
  constructor() {
297
292
  super({
298
293
  id: 'workbench.action.chat.openEditSession',
299
- title: ( localize2(7513, "Open {0}", 'Copilot Edits')),
294
+ title: ( localize2(4186, "Open {0}", 'Copilot Edits')),
300
295
  category: CHAT_CATEGORY,
301
296
  icon: Codicon.goToEditingSession,
302
- precondition: ( (ContextKeyExpr.and(CONTEXT_CHAT_ENABLED, CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED))),
297
+ precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ChatContextKeys.editingParticipantRegistered)),
303
298
  f1: true,
304
299
  menu: [{
305
300
  id: MenuId.ViewTitle,
306
- when: ( (ContextKeyExpr.and(
307
- (ContextKeyExpr.equals('view', CHAT_VIEW_ID)),
308
- CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED
309
- ))),
301
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', ChatViewId)), ChatContextKeys.editingParticipantRegistered, ( ContextKeyExpr.equals(`view.${EditsViewId}.visible`, false)), ( ContextKeyExpr.or(( ContextKeyExpr.and(( ContextKeyExpr.equals(`workbench.panel.chat.defaultViewContainerLocation`, true)), ( ContextKeyExpr.equals(`workbench.panel.chatEditing.defaultViewContainerLocation`, false)))), ( ContextKeyExpr.and(( ContextKeyExpr.equals(`workbench.panel.chat.defaultViewContainerLocation`, false)), ( ContextKeyExpr.equals(`workbench.panel.chatEditing.defaultViewContainerLocation`, true)))))))),
310
302
  group: 'navigation',
311
303
  order: 1
312
304
  }, {
313
305
  id: MenuId.ChatCommandCenter,
314
- when: CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED,
315
- group: 'a_chatEdit',
316
- order: 1
306
+ group: 'a_open',
307
+ order: 2
308
+ }, {
309
+ id: MenuId.ChatEditingEditorContent,
310
+ group: 'navigate',
311
+ order: 4,
317
312
  }],
318
313
  keybinding: {
319
- weight: 200 ,
320
- primary: 2048 | 1024 | 39 ,
314
+ weight: KeybindingWeight.WorkbenchContrib,
315
+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyI,
321
316
  linux: {
322
- primary: 2048 | 512 | 1024 | 39
317
+ primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.KeyI
323
318
  },
324
- when: ( (ContextKeyExpr.and(
325
- (ContextKeyExpr.notEquals('view', EDITS_VIEW_ID)),
326
- CONTEXT_CHAT_EDITING_PARTICIPANT_REGISTERED
327
- )))
319
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.notEquals('view', EditsViewId)), ChatContextKeys.editingParticipantRegistered))
328
320
  }
329
321
  });
330
322
  }
331
323
  async run(accessor, ...args) {
332
324
  const viewsService = accessor.get(IViewsService);
333
- const chatView = await viewsService.openView(EDITS_VIEW_ID);
325
+ const chatView = await viewsService.openView(EditsViewId);
334
326
  chatView.widget.focusInput();
335
327
  }
336
328
  });
@@ -0,0 +1,9 @@
1
+ import { IChatResponseViewModel } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatViewModel";
2
+ import { ICodeBlockActionContext, ICodeCompareBlockActionContext } from "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart";
3
+ export interface IChatCodeBlockActionContext extends ICodeBlockActionContext {
4
+ element: IChatResponseViewModel;
5
+ }
6
+ export declare function isCodeBlockActionContext(thing: unknown): thing is ICodeBlockActionContext;
7
+ export declare function isCodeCompareBlockActionContext(thing: unknown): thing is ICodeCompareBlockActionContext;
8
+ export declare function registerChatCodeBlockActions(): void;
9
+ export declare function registerChatCodeCompareBlockActions(): void;