Skip to content

Commit 8179a13

Browse files
Make the extension.ts docstrings more detailed (#73)
Co-authored-by: Splines <[email protected]>
1 parent f1ac0d8 commit 8179a13

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/extension.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,17 @@ export function deactivate() {
7676
}
7777

7878
/**
79-
* Previews the Manim code of the cell where the cursor is placed
80-
* (when accessed via the command pallette) or the code of the cell where
81-
* the codelens was clicked.
79+
* Previews all code inside of a Manim cell.
80+
*
81+
* A Manim cell starts with ##
82+
*
83+
* This can be invoked by either:
84+
* - clicking the code lens (the button above the cell) -> this cell is previewed
85+
* - command pallette -> the 1 cell where the cursor is is previewed
86+
*
87+
* If Manim isn't running, it will be automatically started
88+
* (at the start of the cell which will be previewed: on its starting ## line),
89+
* and then this cell is previewed.
8290
*/
8391
async function previewManimCell(cellCode?: string, startLine?: number) {
8492
let startLineFinal: number | undefined = startLine;
@@ -113,7 +121,16 @@ async function previewManimCell(cellCode?: string, startLine?: number) {
113121
}
114122

115123
/**
116-
* Previews the Manim code of the selected text.
124+
* Previews the selected code.
125+
*
126+
* - both ends of the selection automatically extend to the start and end of lines
127+
* (for convenience)
128+
* - if Multi-Cursor selection:
129+
* only the first selection is considered
130+
* (TODO: make all selections be considered - expand at each selection)
131+
*
132+
* If Manim isn't running, it will be automatically started
133+
* (before the first selected line).
117134
*/
118135
async function previewSelection() {
119136
const editor = window.activeTextEditor;
@@ -146,8 +163,8 @@ async function previewSelection() {
146163
}
147164

148165
/**
149-
* Runs the `clear()` command in the terminal to remove all objects from
150-
* the scene.
166+
* Runs the `clear()` command in the terminal -
167+
* removes all objects from the scene.
151168
*/
152169
async function clearScene() {
153170
try {

0 commit comments

Comments
 (0)