-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Allow extensions to call cell commands with cell arguments #98282
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
Comments
(Experimental duplicate detection) |
We can add these. Yeah it's not currently possible for an extension to implement it, but it should be. Do you think that instead of using a CancellationToken for cancel, we should have a Or, the extension could just use executeCommand with the cell execution command ID. |
Yes, this works perfectly well for us. This way we can handle execute cells and below, however the assumption is VS Code would display the |
I think it might be hard for us to implement this, for the same reason that we don't implement "execute notebook" by executing cell individually, but tell the notebook to execute the full notebook. We don't know whether cells can be run in parallel, or whether there's a certain order or other requirements. So I don't know whether it would be unhelpful to add a command that does this out of the box. Will think about it more. Actually I think we need an API that can execute N particular cells. We might support multiselect and then I will want to tell the extension to execute all selected cells. So we can solve this just by making the execute callback take an array of cells |
-executeCell(document: NotebookDocument, cell: NotebookCell, token: CancellationToken): Promise<void>;
+executeCell(document: NotebookDocument, cells: NotebookCell[], token: CancellationToken): Promise<void>; and the same token can be used to cancel the execution. Also if the execution involves multiple cells, we may want to show a cancel button on the editor toolbar to cancel the button. |
No longer required. |
In the Python notebook we have commands to run
This is also available in Jupter.
We can add our own commands and icons for this, however there's no way to allow user to cancel the execution.
Today when user runs a cell, they get an individual cancel against each cell, if they run all cells they get a cancel button on the top.
If we (python extension) added our own commands to run the cells, then we'd need our own cancellation icon and I think this would be inconsistent with the current VS Code UI.
Providing at a minimum the VS Code commands such as
notebook.cell.executeAllBelow
¬ebook.cellexecuteAllAbove
and allowing extension authors to execute these would be awesome.@rebornix /cc
The text was updated successfully, but these errors were encountered: