Closed Splines closed 1 week ago
Shoot this is neat stuff, thanks @Splines ! I just checked the functionality and it is really smooth. Code folding works, the preview button works. I also like the choice of ##
as a manim cell. Simple.
Next steps before I merge:
cmd+' cmd+c
?)package.json
. I am trying to make the package.json command descriptions easily searchable (even if other manim extensions popup). Right now, the existing checkpoint-paste command has the phrase vscode-manim
, which I intended to include somewhere in the description of every command exposed through this extension. Would you include vscode-manim
in the cmd description, or propose your own solution to this requirement?## ...
folding logic and button is present in EVERY python file. We don't currently have a way to check that we are in a "manim" file. Can we implement logic to only show this when we are in a manim file?I do not mind what you have done with splitting the logic across files. Certainly, with as much code as was required to make this functionality work, it is better split across files.
I have not had a problem with Intellisense for this project. Weird...
(I see that you have updated the logic in #8. Ignore my request 1)
1 and 2 are dealt with in #8. As point 2 is probably better suited to be placed here: I've just added the respective keybinding in this PR via d2dfdfb8f6cb1. I originally used Ctrl+' Ctrl+e
just because e
is close to r
and Ctrl+c
is strongly anchored in my mind as "cancel"...) But feel free to change it to whatever you like 😇
Help text: I think we should call both the command (viewable in the command palette) and the title of the codelens similarly. E.g. Preview active Manim Cell
for the command and Preview Manim Cell
for the codelens (the fact that it refers to the active cell is already clear when you click on the codelens).
With Manim Cell
(note the capitalized C
), I wanted to create some kind of "brand name" for how we refer to these cells, that's why I included them in the names.
Probably every command is somewhat "interactive" and for the end-user, it's maybe not that important that it's manimgl
invoked in "interactive scene mode" via the arguments -se
in the end. For me, the word preview already somewhat conveys this meaning, that's why I went for Preview active Manim Cell
. But if you think Preview in Interactive Manim
is a better choice, I can for sure change it, not a big deal (in the end I will use those commands with keyboard shortcuts anyways 😅)
For the command descriptions in package.json
: In the specification there is also a category
field. E.g. set it to the string Manim
and all our commands will get Manim:
prepended
Can we implement logic to only show this when we are in a manim file? -> Sure I could give this a try, maybe this is a better fit for a subsequent PR (you don't publish the extension for every commit on main anyways, right?). To detect if we're in a manim file, I'd try to find the class we're in right now and see if that one inherits from either Scene
or InteractiveScene
. Searching for a manim-related import string would be a poor choice in my opinion as even in 3b1b's video repo, he's using something like from manim_imports_ext import *
where `manim_importsext is a custom file at the root of the repo. So imports don't even have to include "manim" as string and yet it could be a Manim-related file. -> see also #12
[x] To-DO: I will fix the branch conflict with main.
With regards to merging: I don't think it's beneficial to merge this PR via a merge commit as then every single commit that I made is on the main
branch, e.g. also commits like Add more docstrings
which is probably not that interesting. To have it a bit tidier, maybe it'd be better to Squash and merge
this PR instead in order to only have one commit: Init Manim Cell detection (#7)
?
The codelens Command also takes tooltip
as argument, maybe there we could include some more text if you'd like to... See for example 3a54a2b as an idea.
I originally used Ctrl+' Ctrl+e just because e is close to r and Ctrl+c is strongly anchored in my mind as "cancel"
This is totally fine, i didn't read #8 thoroughly. Thanks!
... preview active Manim Cell for the command and Preview Manim Cell for the codelens
I like your solution a lot, in fact. Let's call it what you suggest: "Preview Manim Cell" for code lens and "Preview active Manim Cell" for the command
In the specification there is also a category field. E.g. set it to the string Manim and all our commands will get Manim: prepended
THIS is what I was looking for. Thank you! However (and this is worth discussion) I expect others to develop Manim extensions on VSCode and I would like this extension to focus on the interactive workflow (e.g., there is already Manim Sideview whose functionality is orthogonal to that of this project). Indeed, the name of this extension likely needs to be improved from "vscode-manim" which does not capture the emphasis on interactive development. How should we brand this package on the marketplace? This will effect what we choose for the category
of each cmd in package.json
To have it a bit tidier, maybe it'd be better to Squash and merge this PR instead in order to only have one commit
I can certainly click this button as you suggest. I appreciate that you provide guidance on clean commit histories across many collaborators as I have little experience in this regard :)
You don't publish the extension for every commit on main anyways, right?
Correct, I will try to publish 1x/week while things are rapidly developing
Honestly, all these changes look amazing. Merged. Thank you!
Closes #1.
In this PR, we init the cell detection mechanism, i.e. we provide code lenses above what we call a "Manim Cell" as well as folding ranges.
A Manim Cell is introduced by a Python comment starting with
##
instead of just one#
. If we wanted to change this, it's really just one line of code (the definition of the regex). More definitions on where Manim cells start and where they end can be found in respective doc strings.Feature preview
For reviewers
Preview Manim
codelense as well as thePreview active Manim cell
command (that depends on where you placed your cursor).manimCell.ts
actually does many different things, so it's not really single responsibility here, but at least it's all somehow related to the rendering of a manim cell. And after all, themanimCellRanges.ts
file feels very self-contained to me.A side question: does TypeScript IntelliSense work for you in this project? For me I get:
Project Wide IntelliSense not available
and this is quite annoying as IntelliSense is really limited.