My 10 Most Productive VS Code Extensions 🐍
Tags: python, vscode, programming
Published: 2021-04-19 19:29:02

I love [VS Code](https://code.visualstudio.com/) as my editor. It's fast, versatile, and has a ton of extensions.

During my PhD and now in my work as a machine learning engineer, I use VS Code daily, and my productivity has vastly increased by using these extensions. Whether it's working together remotely or cute pets for mental health, the [Marketplace](http://marketplace.visualstudio.com/) has them all. Here are my favourite 10:

{% youtube qoL51QGDVZk %}

## Python, Obviously

The [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) is what tought VS Code Parselmouth. It brings some amazing features, some of which you might have missed.

You can access most settings in VS Code using `Ctrl` + `Shift` + `P`. Type `Refactor` to find some extremely useful Python functionality. You can sort all imports, and semi-automatically refactor code by extracting variables and functions!

### **Sort Imports**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apjmxxql18wpoo82fos6.gif)

reduce the mess up top

### **Extract Variable**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5m5t1hty1i0vqzhga6a4.gif)

shorter lines and reusable calculations

### **Extract Method**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sebgmahxzsu0ee0qh582.gif)

get functions out to reuse and possibly add to our `utils`

### Format Code

Additionally, you can automatically format your code from the settings. This needs the appropriate packages installed. Personally, I recommend `black` but generally anything that helps the linter calm down is great!

## Remote without getting stuck in vim

The [Remote Development extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) has saved my PhD. I was able to work on a GPU server with a nice managed Linux installation, while I was sitting on the mandatory windows machine in my office. This extension lets you sit anywhere with your familiar VS Code and remote into headless server just as well as Docker and even the Windows Subsystem for Linux.

This extension single-handedly convinced my colleagues to switch to VS Code when I started my current position.

## Predictive text but make it ✨code✨

[IntelliCode](https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode) is the predictive text in VS Code. It's fairly robust and will save you a significant amount of keystrokes. It is based on scanning thousands of Github repositories and finding common patterns within. Microsoft focused the extension around:

- Delivering context-aware code completions
- Guiding developers to adhere to their teams patterns and styles
- Finding difficult-to-catch code issues
- Focusing code reviews towards areas that matter

## Never miss a docstring again

Writing docstrings can be a hassle. Not having a docstring means immediate technical debt and increased onboarding cost. [AutoDocstring](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) directly enables docstring templates from function signatures. It works with type-hints even to enhance the docstrings. If you want to step this up a notch, there's a development that builds on AutoDocstring and writes the docstring with state-of-the-art machine learning model codeBert. This [AI docstring extension](https://github.com/graykode/ai-docstring) made a fantastic design choice of running this model in a local docker, which makes it viable in security-sensitive environments.

## Better todos, comments, annotations

The [Better Comments extension](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) is great at leaving colour-coded notes in code. Todos, comments, questions, they all have a specific color that sticks out in the code to alert colleagues and future you.

## git blame but make it inline

The [GitLens extension](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) takes the git capabilities of VS Code to a supercharged level. Line-by-line information when changes and were made and by whom. This enables quick communication about questions and a meaningful commit message can often clear up design decisions. Moreover, it comes with a massive amount of rich enhancements you *need* to check out.

## Dyslexia will thank you

Indents are great, but sometimes they can be hard to follow. The [indent rainbow extension](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow) makes it easy to decipher block alignment.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/we6wnpjls337xjaewuc4.png)

## Stop! Collaborate and Listen.

The [liveshare extension](https://visualstudio.microsoft.com/de/services/live-share/) is Google Docs for code. If you ever had the questionable experience of peer programming on Teams, you will love this as a fantastic alternative.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k63e0dzerb0ag8w3yhuh.png)

## Spelcheak ur coat

I never thought I'd need a [spellcheck extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for code. But I do and you do too. You don't want typos in your function and/or variable names. You don't want silly and embarassing mistakes, when you can avoid them with this free extension.

## Instagram your spaghetti (code)

You may have seen my attempt to share some useful Python snippets. The [Codesnap extension](https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap) makes this ridiculously easy. Just write the code and mark it, out pops a PNG with a clean interface and code highlighting.

What's more you can style your code with themes!

## Bonus extension for extra Cuteness!

There are so many other amazing extensions. Try out [VS Code Pets](https://marketplace.visualstudio.com/items?itemName=tonybaloney.vscode-pets) for some mental health cuteness and [VS Code Spotify](https://marketplace.visualstudio.com/items?itemName=shyykoserhiy.vscode-spotify) to find your most productive tracks!