-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Test: Notebook & Cell level CodeActions #183855
Comments
I can't seem to find this new code action kind in vscode.d.ts. The Code actions work as described, however. |
@Yoyokrazy Using You can check my provider here: https://github.com/microsoft/vscode-github-issue-notebooks/blob/2199dd30d50f1d90688df105a10f86f1cf55b513/src/extension/languageProvider.ts#L566 My config has this
|
@jrieken Did some troubleshooting here, and this is due to the design of the CodeAction SaveParticipant. It's only calling the provider for the first cell of the notebook, to ensure that we aren't running these against every cell. The first cell in the notebook that is in that repo was a markdown cell, which wouldn't connect with the selector you used to register your provider. Once the cells were switched such that a code cell was cell index [0], all of the CodeActions were applied correctly, however the edit being applied wasn't working correctly given your intended functionality. I suspect that this is an issue with the implementation of the provider, as the returned CodeAction still only touched a single cell with its edit. To troubleshoot a bit more, I also removed the |
Refs: #179213
Complexity: 3
Summary:
Notebooks now support CodeActions being run upon save. One extra CodeActionKind has been introduced for CodeActions that apply to the entire scope of the notebook, editing multiple cells (i.e., extracting imports to a top cell, grouping %pip install's, etc.). Source level CodeActions are also supported on an individual cell level. These run in parallel so they are restricted to only editing the resource that is passed to it (the TextDocument of the cell the provider is called upon).
For Notebook Level CodeActions, the provider is only passed the FIRST cell of the notebook, as to not return CodeActions that need to resolve for each cell. Keep this in mind if you choose to create your own provider/action.
Steps to Test:
**note: testing Notebook level CodeActions will require OSS, or tomorrow's (05/31) insiders build
notebook.codeActionsOnSave
, and add your CodeActions.Things to check
If you want to do more
Thanks so much for testing!
The text was updated successfully, but these errors were encountered: