C# extensions for VS Code

10 Extensions to increase your C# Productivity in VS Code

A few extensions from my setup to help you code in C# with VS Code

Andre Lopes
Checkout.com-techblog
5 min readMar 28, 2022

--

Photo by AltumCode on Unsplash

Hello everyone!

What I love most about Visual Studio Code is that it is highly customizable to fit your needs. This is very useful when tailoring it to improve your productivity.

Here I’ll show a few extensions I use to improve my C# coding.

Extensions

C#

The first and most crucial extension you need for C# coding is the C# extension.

This extension mainly adds C# and .NET support to VS Code, including Syntax Highlighting, IntelliSense, Go to Definition, Find All References, debugging support, and many others. It is powered by OmniSharp.

C# Extensions

This extension adds a few useful things to VS Code that were missing.

It adds buttons to create classes and interfaces.

Create class and interface

It also enables you to create fields from constructor parameters without the this keyword and with the prefix you define (this you can set specifically on the configurations).

C# Extensions configurations
Initialize field from parameter

GitLens

If you are working on projects with git, this extension is a lifesaver.

It adds many features for visualizing git information to the Source Control tab, such as commits, repositories, file history, branches, remotes, stashes, and tags.

GitLens tabs in Source Control

In addition, it adds an inline feature to visualize who was responsible for last committing a change to a specific line of code, class, or namespace.

Inline commit information

GitHub Pull Request

If you don’t want to go to GitHub every time you push a new branch and want to create a pull request from it, this extension is for you.

It allows you to create and manage pull requests directly from VS Code.

Create a pull request
Manage pull request

You can check all other pull requests available on the repository, and you can even comment and view other comments regarding that pull request on the code.

Managing, commenting, and viewing comments about the pull request

Auto-Using for C#

Auto-Using removes the necessity of you having to add the necessary using for the code you are writing. It automatically adds it for you once you select the code you are looking for in IntelliSense.

Auto-Using in action.

C# Sort Using

An extension to fix your using organization. It automatically organizes your using in alphabetical.

You can also set which using comes first. By default, it is System, then Microsoft, and then other namespaces.

Sort-Usings in action.

EditorConfig for VS Code

This extension enables EditorConfig support in VS Code.

It attempts to override user/workspace settings with settings found in .editorconfig files.

EditorConfig files are handy when you want to have project code format standards across your team.

Here is an example .editorconfig file:

# This file is the top-most EditorConfig file
root = true
# All Files
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
# Visual Studio Solution Files
[*.sln]
indent_style = tab
# Visual Studio XML Project Files
[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
# XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
indent_size = 2
# JSON Files
[*.{json,json5,webmanifest}]
indent_size = 2
# YAML Files
[*.{yml,yaml}]
indent_size = 2
# Markdown Files[*.md]
trim_trailing_whitespace = false
# Web Files[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,pcss,svg}]
indent_size = 2
# Batch Files[*.{cmd,bat}]
end_of_line = crlf
# Bash Files[*.sh]
end_of_line = lf

Code Spell Checker

Code Spell Checker is a simple extension that helps you avoid common spelling errors on your code.

Code Spell Check in action

Todo Tree

Todo Tree helps you locate and maintain those lost TODO , FIXME and other TODO comments in your code.

It highlights TODO items, creates a nice tree structure to help you visualize all your TODO items, and even takes you to the desired TODO if you click on it.

Todo Tree demonstration

Material Icon Theme

This extension provides an easy way to identify your project files. It adds specific and colorful icons to your files, depending on their extension.

This is personally my favorite icons theme.

Material Icon Theme

Conclusion

Visual Studio Code customizability is impressive. Every day new extensions are released that can change your coding experience. The good thing is that you can select any extension based on your needs.

In this article, I showed you extensions that I use to improve my C# coding productivity. I hope that these extensions can also help you.

And you? What are your favorite extensions for improving your coding in C#?

Happy coding.

--

--

Andre Lopes
Checkout.com-techblog

Full-stack developer | Casual gamer | Clean Architecture passionate