Skip to content

Commit

Permalink
avoid RPC loop when there are no cells to execute / dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Donham committed Apr 18, 2024
1 parent 2247ffe commit f0ba51b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ class VitaleDevServer {
}

private markCellsDirty(cells: { path: string; cellId: string }[]) {
if (cells.length === 0) {
return;
}
for (const client of this.clients.values()) {
client.markCellsDirty(cells);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/vscode/src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export class NotebookController {
}

private async executeCells(notebookCells: vscode.NotebookCell[]) {
if (notebookCells.length === 0) {
return;
}
const cells = notebookCells.map((cell) => ({
path: cell.notebook.uri.fsPath,
cellId: cell.metadata.id,
Expand Down

0 comments on commit f0ba51b

Please sign in to comment.