Rickaym / manim-sideview

A Manim utility extension for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=Rickaym.manim-sideview
MIT License
108 stars 11 forks source link

More explicit error message for manim options #101

Closed e-dervieux closed 5 days ago

e-dervieux commented 2 weeks ago

When using an external config.cfg file, the error message in case of incorrect option value is not very explicit.

For instance, when putting quality=medium the error message is the following:

Manim Sideview: "medium" is an invalid quality value provided in the configuration.

Yet, if launching the same manim compilation from the terminal, the error message ends up with:

File "/.../python3.12/site-packages/manim/_config/utils.py", line 1314, in quality
    raise KeyError(f"quality must be one of {list(constants.QUALITIES.keys())}")
KeyError: "quality must be one of ['fourk_quality', 'production_quality', 'high_quality', 'medium_quality', 'low_quality', 'example_quality']"

Which is much more explicit as to what options are valid. Now this would not be that much of an issue if manim's documentation was explicit about that, i.e. if the command line flag -q was stated to work with any of the 'fourk_quality', 'production_quality', 'high_quality', 'medium_quality', 'low_quality', 'example_quality' value somewhere. However, this is - to the best of my knowledge - documented nowhere, and the only mentions I could find on the web were into manim's code source...

While this is clearly an issue with manim's documentation, I think that forwarding manim's error output to sideview's error popup and offering the possibility to display it with a drop-down menu would be very nice. Something like:

image


Note: maybe this applies to other sideview's error messages as well.

Rickaym commented 2 weeks ago

Hey, thank you for your suggestion. I will include this in the next release.

Rickaym commented 5 days ago

I noticed here that the popup comes up before any code is executed since validating the configuration file is part of the extension's job, which perhaps in retrospect, can be relied on manim itself. For the upcoming patch, I have resorted to displaying a better popup, but in the future, I think it'd be best to overhaul the system to work differently. image