-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure proper sequencing of notebook cell edits #241350
Conversation
export interface IChatNotebookEditGroup { | ||
uri: URI; | ||
edits: ICellEditOperation[][]; | ||
edits: (ICellTextEditOperation | ICellEditOperation)[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text edits belonging to a notebook must belong to notebookGroup
This way the order is preserved and its clear these text edits belong to notebooks.
When you call |
Sorry not following you here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking more, I think this should work fine :) I might do a pass later and see if I can get rid of the any
cast (we had one there before, so not something you need to clean in this PR unless you want to)
3e458bf
to
83883c1
Compare
@@ -708,13 +708,20 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio | |||
let didComplete = false; | |||
|
|||
return { | |||
pushText: edits => { | |||
pushText: (edits) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@connor4312 @DonJayamanne Can we align these and just have pushEdits(uri, edits)
because all these call _acceptEdits
Problem
Assume we generate a single text edit for a single cell in a notebook
Sequence of messages emitted is as follows
And they get process as follows in
handleResponseParts
ofchatEditingServiceImpl
:I think the problem lies with the fact that the
textEdits
are not treated as part of thenotebookEditGroup
.Ideally they should be part of that so that they are processes in order.
Or we bring the knowledge of notebook Cell Edits into this area and look at the Uris and do something else to ensure any text edits for a cell URI that belong to an existing
notebookgroup
must be processed first and thenotebookGroup.done
must be processed after all othertextEditGroup
... feels icky..@jrieken @connor4312 /cc