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

Support for Notebook CodeAction Kind #183457

Merged
merged 3 commits into from May 30, 2023
Merged

Support for Notebook CodeAction Kind #183457

merged 3 commits into from May 30, 2023

Conversation

Yoyokrazy
Copy link
Contributor

re: #179213

Add in proposed api for the new CodeActionKind of Notebook

Formally support notebook codeactions on save for ipynb notebook files. Notebook Save Participants first call the providers for the first cell of the notebook, running all notebook specific actions across the entire notebook. Once they resolve, providers are called for all cells in the notebook, performing source level actions on each cell in parallel.

As stated in the proposed api, any CodeAction with the Notebook will only be called for the first cell of the notebook, and all CodeActions not with that kind must only apply edits to the single cell that they are passed.

Copy link
Member

@rebornix rebornix left a comment

Choose a reason for hiding this comment

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

Looks good to me in overall, only concern is we are adding the notebook type into Monaco editor. We might want to keep it in workbench/contrib/notebook.

src/vs/editor/contrib/codeAction/common/types.ts Outdated Show resolved Hide resolved
@rebornix rebornix dismissed their stale review May 26, 2023 22:44

Updated code

// https://github.com/microsoft/vscode/issues/179213

export class NotebookCodeActionKind {
// can only return MULTI CELL workspaceEdits
Copy link
Contributor

Choose a reason for hiding this comment

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

Debt: could the comment be a docstring?

@@ -152,6 +154,9 @@ class CodeActionOnSaveParticipant implements IStoredFileWorkingCopySaveParticipa
});
}


Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra spacing

@Yoyokrazy Yoyokrazy merged commit 5d83e25 into main May 30, 2023
6 checks passed
@Yoyokrazy Yoyokrazy deleted the milively/nb-ca branch May 30, 2023 18:03
@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 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.

None yet

4 participants