Onivim supports several features from Microsoft's
vscode-python extension, including:
- Code completion
- Signature Help
NOTE: There is a blocking bug (https://github.com/microsoft/vscode-python/issues/12465) in the latest open-vsx package, so the extension needs to be installed manually.
- Download the extension: https://github.com/microsoft/vscode-python/releases/download/2020.5.86806/ms-python-release.vsix
oni2 --install-extension /path/to/ms-python-release.vsix
- Activate your virtual environment in your python project
oni2from your python project folder
If all goes well - you'll see the current python interpreter in the status bar:
I'm not getting completions or diagnostics - what can I try?
- Make sure you start Onivim from the active virtual environment. This will set the path to the python modules for the vscode-python extension.
- If the Python interpreter is not inferred correctly, you can set the
"python.pythonPath": "/path/to/python"configuration setting manually.
- If the modules your project using are in a non-standard location, you can add them via the
"python.autoComplete.extraPaths": ["/path/to/customModule"]configuration setting.