An unofficial stub generator for vapoursynth and its plugins, which is helpful to autocomplete code in VSCode.
1.(Onekey install) Place the whole folder VapourSynth-Plugins-Stub-Generator
at the same path of python.exe
of vapoursynth.
run the onekey install.bat
.
Done!
2.(Install manually) 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. Move it to where your language server or library like Jedi can recognize.
For VSCode users, there are some simpler way to generate the stub file.
For Pylance or Microsoft Python Language Server users, run the command to install the stub file:
python vs_plugins_helper.py install vapoursynth
For Jedi or JediLSP users, run the command to install the stub file:
python vs_plugins_helper.py install vscode
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 and tasks.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/