Skip to content
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

Add notebook Format On Cell Execution #182924

Merged
merged 5 commits into from
May 22, 2023
Merged

Add notebook Format On Cell Execution #182924

merged 5 commits into from
May 22, 2023

Conversation

Yoyokrazy
Copy link
Contributor

@Yoyokrazy Yoyokrazy commented May 18, 2023

Fix: vscode-jupyter/7058

Hook into NotebookExecutionService and add support for formatting cells upon execution. Uses validCellExecutions and formats based on cells present in that array.

Formatting is implemented similar to what is used in src\vs\workbench\contrib\notebook\browser\contrib\format\formatting.ts and src\vs\workbench\contrib\notebook\browser\contrib\saveParticipants\saveParticipants.ts. Could this be reworked into a different location where multiple spots could leverage the same formatter? Rather than just reusing code in various locations.

@Yoyokrazy Yoyokrazy self-assigned this May 18, 2023
@vscodenpa vscodenpa added this to the May 2023 milestone May 18, 2023
@Yoyokrazy Yoyokrazy requested review from roblourens and removed request for rebornix May 19, 2023 23:56
@Yoyokrazy Yoyokrazy merged commit ae851a3 into main May 22, 2023
@Yoyokrazy Yoyokrazy deleted the milively/formatCellOnRun branch May 22, 2023 19:22
return toDisposable(() => this.cellExecutionParticipants.delete(participant));
}

async runExecutionParticipants(executions: INotebookCellExecution[]): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be private unless there's a reason to expose it publicly

Copy link
Contributor Author

@Yoyokrazy Yoyokrazy May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by: 183164, missed your point on the first read through. Appreciate the help and review through this.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Format cell on run like the nb_black extension does.
4 participants