VS Code Extensions for Python
What are your favorite extensions for VSCODE that make coding in Python easier?
How To Make A VS Code Extension In Python - Stack Overflow
A look into workflow tools - package management in the Python extension for VS Code - Packaging - Discussions on Python.org
Videos
Hi everyone, can you share some of the VS Code extensions you use to improve your coding experience? I know the most common extensions, like Prettier, BetterComments and SpellChecker, but I'm sure there are some hidden gems out there, hope you can help me find some! Thank you all
I just learned about autoDocstring last night and I'm blown away how nice this extension is. It makes creating docstrings so much easier and automated. Personally, I'm a fan of Google's style for docstrings so that's what I've set my default to when generating docstrings!
Another favorite extension of mine is this linter: Ruff. However, it is a bit buggy in that it duplicates functions at the bottom of the file, but other than that I love it!
Lastly, this is not an extension, but I love the Black library and auto-saving my .py files with this formatting provider in VSCODE.
I'm curious what this communities' favorite extensions are that make coding in Python easier or automated?
VS Code is built on Electron framework which run with Node.js, so it's impossible to make a extension "directly" using Python. However you can use these two ways to keep your stuff mainly in Python:
- Node.js allows you to call outside scripts using
child_process. it is often used to achieve multi-threading in Node.js. - If you are developing a language extension, you should give Language Server with LSP a try. By doing this you can start up a server written by Python and communicate with VSC JS client using LSP.
Note that both ways requires you to write some JS/TS code.
VS Code has official documentation on using the Langugage Server/LSP to create a python extension: https://code.visualstudio.com/api/advanced-topics/python-extension-template
If you prefer to use the child_process approach, there is an unofficial python wrapper: https://github.com/CodeWithSwastik/vscode-ext?u=t&m=o#example-extension