@codingame/monaco-vscode-chat-service-override 11.1.2 → 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.
- package/index.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +32 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
- package/chat.js +0 -59
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -172
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
4
|
import { AsyncIterableObject } from 'vscode/vscode/vs/base/common/async';
|
|
4
5
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
5
6
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
7
|
+
import { CharCode } from 'vscode/vscode/vs/base/common/charCode';
|
|
6
8
|
import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
7
9
|
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
8
10
|
import { splitLines } from 'vscode/vscode/vs/base/common/strings';
|
|
@@ -16,15 +18,16 @@ import { localize } from 'vscode/vscode/vs/nls';
|
|
|
16
18
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
17
19
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
18
20
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
21
|
+
import { ProgressLocation } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
19
22
|
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
20
23
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
21
24
|
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
22
|
-
import { InlineChatController } from '@codingame/monaco-vscode-
|
|
23
|
-
import { insertCell } from '@codingame/monaco-vscode-
|
|
25
|
+
import { InlineChatController } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
26
|
+
import { insertCell } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
|
24
27
|
import { CellKind, NOTEBOOK_EDITOR_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
25
28
|
import { getReferencesAsDocumentContext } from '../../common/chatCodeMapperService.js';
|
|
26
29
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
27
|
-
import { isResponseVM, isRequestVM } from '@codingame/monaco-vscode-
|
|
30
|
+
import { isResponseVM, isRequestVM } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
28
31
|
|
|
29
32
|
let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
30
33
|
constructor(editorService, textFileService, bulkEditService, codeEditorService, chatService, languageService, dialogService) {
|
|
@@ -48,7 +51,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
48
51
|
}
|
|
49
52
|
else {
|
|
50
53
|
this.notify(( localize(
|
|
51
|
-
|
|
54
|
+
4262,
|
|
52
55
|
"To insert the code block, open a code editor or notebook editor and set the cursor at the location where to insert the code block."
|
|
53
56
|
)));
|
|
54
57
|
}
|
|
@@ -61,7 +64,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
61
64
|
}
|
|
62
65
|
async handleNotebookEditor(notebookEditor, codeBlockContext) {
|
|
63
66
|
if (notebookEditor.isReadOnly) {
|
|
64
|
-
this.notify(( localize(
|
|
67
|
+
this.notify(( localize(4263, "Cannot insert the code block to read-only notebook editor.")));
|
|
65
68
|
return false;
|
|
66
69
|
}
|
|
67
70
|
const focusRange = notebookEditor.getFocus();
|
|
@@ -72,29 +75,29 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
72
75
|
async handleTextEditor(codeEditor, codeBlockContext) {
|
|
73
76
|
const activeModel = codeEditor.getModel();
|
|
74
77
|
if (isReadOnly(activeModel, this.textFileService)) {
|
|
75
|
-
this.notify(( localize(
|
|
78
|
+
this.notify(( localize(4264, "Cannot insert the code block to read-only code editor.")));
|
|
76
79
|
return false;
|
|
77
80
|
}
|
|
78
|
-
const range = codeEditor.getSelection() ?? (
|
|
81
|
+
const range = codeEditor.getSelection() ?? ( new Range(activeModel.getLineCount(), 1, activeModel.getLineCount(), 1));
|
|
79
82
|
const text = reindent(codeBlockContext.code, activeModel, range.startLineNumber);
|
|
80
|
-
const edits = [(
|
|
83
|
+
const edits = [( new ResourceTextEdit(activeModel.uri, { range, text }))];
|
|
81
84
|
await this.bulkEditService.apply(edits);
|
|
82
|
-
this.codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === (
|
|
85
|
+
this.codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === ( activeModel.uri.toString()))?.focus();
|
|
83
86
|
return true;
|
|
84
87
|
}
|
|
85
88
|
notify(message) {
|
|
86
89
|
this.dialogService.info(message);
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
|
-
InsertCodeBlockOperation = (
|
|
90
|
-
(
|
|
91
|
-
(
|
|
92
|
-
(
|
|
93
|
-
(
|
|
94
|
-
(
|
|
95
|
-
(
|
|
96
|
-
(
|
|
97
|
-
], InsertCodeBlockOperation))
|
|
92
|
+
InsertCodeBlockOperation = ( __decorate([
|
|
93
|
+
( __param(0, IEditorService)),
|
|
94
|
+
( __param(1, ITextFileService)),
|
|
95
|
+
( __param(2, IBulkEditService)),
|
|
96
|
+
( __param(3, ICodeEditorService)),
|
|
97
|
+
( __param(4, IChatService)),
|
|
98
|
+
( __param(5, ILanguageService)),
|
|
99
|
+
( __param(6, IDialogService))
|
|
100
|
+
], InsertCodeBlockOperation));
|
|
98
101
|
let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
99
102
|
constructor(editorService, textFileService, bulkEditService, codeEditorService, chatService, languageFeaturesService, progressService, languageService, fileService, dialogService, logService) {
|
|
100
103
|
this.editorService = editorService;
|
|
@@ -112,7 +115,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
112
115
|
async run(context) {
|
|
113
116
|
if (this.inlineChatPreview && this.inlineChatPreview.isOpen()) {
|
|
114
117
|
await this.dialogService.info(( localize(
|
|
115
|
-
|
|
118
|
+
4265,
|
|
116
119
|
"Another code change is being previewed. Please apply or discard the pending changes first."
|
|
117
120
|
)));
|
|
118
121
|
return;
|
|
@@ -143,7 +146,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
143
146
|
result = await this.handleNotebookEditor(activeNotebookEditor, context);
|
|
144
147
|
}
|
|
145
148
|
else {
|
|
146
|
-
this.notify(( localize(
|
|
149
|
+
this.notify(( localize(4266, "To apply this code block, open a code or notebook editor.")));
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
notifyUserAction(this.chatService, context, {
|
|
@@ -156,7 +159,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
156
159
|
}
|
|
157
160
|
async handleNotebookEditor(notebookEditor, codeBlockContext) {
|
|
158
161
|
if (notebookEditor.isReadOnly) {
|
|
159
|
-
this.notify(( localize(
|
|
162
|
+
this.notify(( localize(4267, "Cannot apply code block to read-only notebook editor.")));
|
|
160
163
|
return undefined;
|
|
161
164
|
}
|
|
162
165
|
const focusRange = notebookEditor.getFocus();
|
|
@@ -166,7 +169,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
166
169
|
}
|
|
167
170
|
async handleTextEditor(codeEditor, codeBlockContext) {
|
|
168
171
|
if (isReadOnly(codeEditor.getModel(), this.textFileService)) {
|
|
169
|
-
this.notify(( localize(
|
|
172
|
+
this.notify(( localize(4268, "Cannot apply code block to read-only file.")));
|
|
170
173
|
return undefined;
|
|
171
174
|
}
|
|
172
175
|
const result = await this.computeEdits(codeEditor, codeBlockContext);
|
|
@@ -175,7 +178,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
175
178
|
if (!showWithPreview) {
|
|
176
179
|
await this.bulkEditService.apply(result.edits, { showPreview: true });
|
|
177
180
|
const activeModel = codeEditor.getModel();
|
|
178
|
-
this.codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === (
|
|
181
|
+
this.codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === ( activeModel.uri.toString()))?.focus();
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
return result;
|
|
@@ -187,13 +190,13 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
187
190
|
const docRefs = [];
|
|
188
191
|
collectDocumentContextFromSelections(codeEditor, docRefs);
|
|
189
192
|
collectDocumentContextFromContext(codeBlockActionContext, docRefs);
|
|
190
|
-
const cancellationTokenSource = (
|
|
193
|
+
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
191
194
|
let codeMapper;
|
|
192
195
|
try {
|
|
193
|
-
const result = await this.progressService.withProgress({ location:
|
|
196
|
+
const result = await this.progressService.withProgress({ location: ProgressLocation.Notification, delay: 500, sticky: true, cancellable: true }, async (progress) => {
|
|
194
197
|
for (const provider of mappedEditsProviders) {
|
|
195
198
|
codeMapper = provider.displayName;
|
|
196
|
-
progress.report({ message: ( localize(
|
|
199
|
+
progress.report({ message: ( localize(4269, "Applying code block using {0}...", codeMapper)) });
|
|
197
200
|
const mappedEdits = await provider.provideMappedEdits(activeModel, [codeBlockActionContext.code], {
|
|
198
201
|
documents: docRefs,
|
|
199
202
|
conversation: getChatConversation(codeBlockActionContext),
|
|
@@ -210,7 +213,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
210
213
|
}
|
|
211
214
|
catch (e) {
|
|
212
215
|
if (!isCancellationError(e)) {
|
|
213
|
-
this.notify(( localize(
|
|
216
|
+
this.notify(( localize(4270, "Failed to apply code block: {0}", e.message)));
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
finally {
|
|
@@ -226,9 +229,9 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
226
229
|
return false;
|
|
227
230
|
}
|
|
228
231
|
const resource = firstEdit.resource;
|
|
229
|
-
const textEdits = coalesce((
|
|
232
|
+
const textEdits = coalesce(( edits.map(
|
|
230
233
|
edit => ResourceTextEdit.is(edit) && isEqual(resource, edit.resource) ? edit.textEdit : undefined
|
|
231
|
-
)))
|
|
234
|
+
)));
|
|
232
235
|
if (textEdits.length !== edits.length) {
|
|
233
236
|
return false;
|
|
234
237
|
}
|
|
@@ -236,7 +239,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
236
239
|
if (editorToApply) {
|
|
237
240
|
const inlineChatController = InlineChatController.get(editorToApply);
|
|
238
241
|
if (inlineChatController) {
|
|
239
|
-
const tokenSource = (
|
|
242
|
+
const tokenSource = ( new CancellationTokenSource());
|
|
240
243
|
let isOpen = true;
|
|
241
244
|
const firstEdit = textEdits[0];
|
|
242
245
|
editorToApply.revealLineInCenterIfOutsideViewport(firstEdit.range.startLineNumber);
|
|
@@ -268,19 +271,19 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
268
271
|
this.dialogService.info(message);
|
|
269
272
|
}
|
|
270
273
|
};
|
|
271
|
-
ApplyCodeBlockOperation = (
|
|
272
|
-
(
|
|
273
|
-
(
|
|
274
|
-
(
|
|
275
|
-
(
|
|
276
|
-
(
|
|
277
|
-
(
|
|
278
|
-
(
|
|
279
|
-
(
|
|
280
|
-
(
|
|
281
|
-
(
|
|
282
|
-
(
|
|
283
|
-
], ApplyCodeBlockOperation))
|
|
274
|
+
ApplyCodeBlockOperation = ( __decorate([
|
|
275
|
+
( __param(0, IEditorService)),
|
|
276
|
+
( __param(1, ITextFileService)),
|
|
277
|
+
( __param(2, IBulkEditService)),
|
|
278
|
+
( __param(3, ICodeEditorService)),
|
|
279
|
+
( __param(4, IChatService)),
|
|
280
|
+
( __param(5, ILanguageFeaturesService)),
|
|
281
|
+
( __param(6, IProgressService)),
|
|
282
|
+
( __param(7, ILanguageService)),
|
|
283
|
+
( __param(8, IFileService)),
|
|
284
|
+
( __param(9, IDialogService)),
|
|
285
|
+
( __param(10, ILogService))
|
|
286
|
+
], ApplyCodeBlockOperation));
|
|
284
287
|
function notifyUserAction(chatService, context, action) {
|
|
285
288
|
if (isResponseVM(context.element)) {
|
|
286
289
|
chatService.notifyUserAction({
|
|
@@ -369,7 +372,7 @@ function reindent(codeBlockContent, model, seletionStartLine) {
|
|
|
369
372
|
}
|
|
370
373
|
const formattingOptions = model.getFormattingOptions();
|
|
371
374
|
const codeIndentLevel = computeIndentation(model.getLineContent(seletionStartLine), formattingOptions.tabSize).level;
|
|
372
|
-
const indents = (
|
|
375
|
+
const indents = ( newContent.map(line => computeIndentation(line, formattingOptions.tabSize)));
|
|
373
376
|
const newContentIndentLevel = indents.reduce((min, indent, index) => {
|
|
374
377
|
if (indent.length !== newContent[index].length) {
|
|
375
378
|
return Math.min(indent.level, min);
|
|
@@ -396,7 +399,7 @@ function computeIndentation(line, tabSize) {
|
|
|
396
399
|
const len = line.length;
|
|
397
400
|
while (i < len) {
|
|
398
401
|
const chCode = line.charCodeAt(i);
|
|
399
|
-
if (chCode ===
|
|
402
|
+
if (chCode === CharCode.Space) {
|
|
400
403
|
nSpaces++;
|
|
401
404
|
if (nSpaces === tabSize) {
|
|
402
405
|
level++;
|
|
@@ -404,7 +407,7 @@ function computeIndentation(line, tabSize) {
|
|
|
404
407
|
length = i + 1;
|
|
405
408
|
}
|
|
406
409
|
}
|
|
407
|
-
else if (chCode ===
|
|
410
|
+
else if (chCode === CharCode.Tab) {
|
|
408
411
|
level++;
|
|
409
412
|
nSpaces = 0;
|
|
410
413
|
length = i + 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|