An unofficial stub generator for vapoursynth and its plugins, which is helpful to autocomplete code in VSCode.
At first, you need to have a python with vapoursynth installed. You can check it with
python -c 'from vapoursynth import core; print(core.version())'
Then run the command:
python vs_plugins_helper.py
A file called vapoursynth.pyi
should be created at where you run the command. Move it to where your language server or library like Jedi can recognize.
Generating a stub-only package named vapoursynth-stubs
usually helps a lot. You can install the vsstubs
package by pip
and then install the *-stubs
package.
python -m pip install .\vsstubs\
python -m vsstubs install
All language servers in VSCode should work with such a package to autocomplete your code.
Once you have installed the stub file, you can update it if there are some new filters added to vapoursynth
after installation.
python -m vsstubs update
For more usage and mode, get the help message by
python -m vsstubs help
Files in .vscode
folder might be helpful to set up VSCode.
-
Install VSCode, then install Python extension and Pylance in VSCode extension market.
-
Paste the settings.json to the user settings folder1 or work area settings folder2. This will enable the python code highlighting and autocompletion.
-
Paste the tasks.json to the user settings folder1 or work area settings folder2, and paste the keybindings.json to your vscode user settings folder1. This will enable shift+f5/f6 hotkeys as f5/f6 in vsedit.
-
Remember to change
"path\\to\\your\\VapourSynth\\python.exe"
in settings.json to your own python interpreter.
1: Usually refer to %APPDATA%\Code\User\
on Windows and $HOME/.config/Code/User/
on Linux
2: Usually refer to /path/to/your/workdir/.vscode/