Award winning.
A proud
Esri
business partner.
Together
we can do anything!

5 Useful Visual Studio Code Extensions

 

Over the years Visual Studio (VS) code has become a staple in the web developer toolkit, and it’s easy to understand why. Out of the box VS code comes with intelliSense, debugging, Git and extensions. All of these built-in features propel VS code strides ahead of other text editors. Today we’re going to look into how we can further enhance our experience and productivity with 5 easy ways to use these super helpful extensions.

To access extensions, click the square at the bottom of the sidebar. This is where you’ll be able to search and see what’s installed.

 

visual studio code
Image from Visual Studio Code

 

1) Live Server

 

Live Server is a great extension that allows developers to deploy a server locally for both static and dynamic pages. The best part is that it also comes with a live reload feature, which will refresh your website when saved. Using Live Server is easy and can be done in two ways.

 

Click the button at the bottom of the screen that reads Go Live or in your HTML page press (Alt + L O). Once clicked a new tab will open in your browser with your website.

 

visual studio code
Image from Visual Studio Code

 

If you go back to VS Code, the Port your website is running on will now be displayed at the bottom. To kill the server simply click the Port button, or from your HTML page press (Alt + L C).

 

visual studio code
Image from Visual Studio Code

 

2) Brackets Pair Colorizer

 

Brackets allow developers to read and keep track of their Javascript with color coding. This extension gives each set of brackets their own color and also helps identify which scope you are in. Here is what it looks like by default when we have three sets of brackets nested. Next to it are the same brackets but with Brackets Colorizer.

 

visual studio code
Image from Visual Studio Code

 

visual studio code
Image from Visual Studio Code

 

Here is another example with a function.

 

visual studio code
Image from Visual Studio Code

 

This extension also helps developers identify what scope they are in.

 

visual studio code
Image from Visual Studio Code

3) CSS Peeks

 

It’s not unusual to have several css files or one huge css file with hundreds (if not thousands) of lines of css. CSS Peeks makes for easy navigation. Gone are the days where you have to copy the name of the class and Ctrl + F in the css file.

 

With CSS Peeks you click the class name in the html and press Fn + Alt + F12 (depending on computer). An inline window to your css will appear. Here developers can make edits to their css.

 

visual studio code
Image from Visual Studio Code

4) JavaScript (ES6) Code Snippets

 

This is a great extension if you want to be fast, as ES6 code snippets have pre-installed ES6 syntax. By typing a few letters followed by Tab, developers can write several lines of code. Here are a few basic triggers, for full list see extension page.

 

*Make sure no other code snippets are enabled as triggers might be the same.

 

fre forEach loop in ES6 syntax array.forEach(currentItem => {})
anfn creates an anonymous function (params) => {}
nfn creates a named function const add = (params) => {}
prom creates a new Promise return new Promise((resolve, reject) => {});
con adds default constructor in the class constructor() {}

 

5) ES7 React/Redux/GraphQL/React-Native Snippets

 

React-native snippets are similar to the previous extension, where speed is the name of the game. The major difference between this extension and the last is, these snippets have a strong focus on React, GraphQL and React-Native. To use write the triggers (letters) followed by Tab. Here are a few basic triggers, for full list see extension page.

 

*Make sure no other code snippets are enabled as triggers might be the same.

 

sst this.setState({ })
imrd import ReactDom from ‘react-dom’
imrc import React, { Component } from ‘react’
cdm componentDidMount = () => { }
ren render() { return( ) }

 

Get Support

 

What are your favorite extensions? Did we miss anything? Is there an extension you can’t live without? Tweet us @geomarvel to let us know!

 

Our team of experts are here to support your unique project needs, from development to deployment. Have an idea? Reach out to start a conversation today.