Skip to content

Commit

Permalink
Ensure notebook document event registration (#14242)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored Oct 8, 2024
1 parent 92f4720 commit 0f15ab6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,16 @@ export class NotebooksAndEditorsMain implements NotebookDocumentsAndEditorsMain
addedEditors: delta.addedEditors.map(NotebooksAndEditorsMain.asEditorAddData),
};

// send to extension FIRST
await this.proxy.$acceptDocumentsAndEditorsDelta(dto);

// handle internally
// Handle internally first
// In case the plugin wants to perform documents edits immediately
// we want to make sure that all events have already been setup
this.notebookEditorsMain.handleEditorsRemoved(delta.removedEditors);
this.notebookDocumentsMain.handleNotebooksRemoved(delta.removedDocuments);
this.notebookDocumentsMain.handleNotebooksAdded(delta.addedDocuments);
this.notebookEditorsMain.handleEditorsAdded(delta.addedEditors);

// Send to plugin last
await this.proxy.$acceptDocumentsAndEditorsDelta(dto);
}

private static isDeltaEmpty(delta: NotebookAndEditorDelta): boolean {
Expand Down

0 comments on commit 0f15ab6

Please sign in to comment.