Description
We currently have a "cell" scope type, but it only supports the "pour" action. For example, you can say "pour cell" and "pour cell air", but not "swap cell air with bat", etc.
- Handle ranges of cells as well as single cells and lists of cells
Actions to support
-
"bring"
-
"move"
-
"swap"
-
"chuck"
-
"pour"
-
"drink"
-
"clear"
-
"copy"
-
"carve"
-
"paste"
-
"clone"
-
"clone up"
-
"fold"
-
"unfold"
-
"center"
-
"drop"
? -
"float"
?
Implementation
We should be able to implement some of them by simply selecting the cell and then running a notebook command. VSCode has lots of notebook commands; try saying "please notebook" with a notebook open.
Other commands will take a bit more care for example move and bring. We should be able todo these by eg selecting one or more cells and repeating a move-downwards command multiple times
Could possibly just use the CommandAction class, though might need to tweak to support multi-cell selection. It's worth checking though for each of the given actions whether there is a vscode action which accepts a cell as an argument, tho this seems quite unlikely
Helpful links
- The
focusNotebookCell
function has examples of getting notebook cell from editor and manipulating notebook selections at cell level - Example of a test for notebook cell operation https://github.com/pokey/cursorless-vscode/blob/main/src/test/suite/crossCellsSetSelection.test.ts
EditNew
has an example of overriding action behaviour for notebook cell target