improve CodeCompareBlockPart (#210964)

* polish code compare block for chat widgets

* show edits unless applied
* show summary after applying
* know when original file has changed

* don't double apply edits

* separate `IChatTextEdit` (progress chunk) and `IChatTextEditGroup` (response value) so that latter can hold extra state and allows for groups of edits

* fix compile errors
This commit is contained in:
Johannes Rieken
2024-04-22 15:28:59 -07:00
committed by GitHub
parent 6622042969
commit ba65916262
12 changed files with 277 additions and 101 deletions

View File

@@ -504,13 +504,15 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
for (const item of response.response.value) {
if (item.kind === 'markdownContent') {
markdownContent.value += item.content.value;
} else if (item.kind === 'textEdit') {
for (const edit of item.edits) {
raw.edits.edits.push({
resource: item.uri,
textEdit: edit,
versionId: undefined
});
} else if (item.kind === 'textEditGroup') {
for (const group of item.edits) {
for (const edit of group) {
raw.edits.edits.push({
resource: item.uri,
textEdit: edit,
versionId: undefined
});
}
}
}
}