Using Visual Studio Code on Mac OS X

At the BULID 2015 conference in San Francisco last week, Microsoft put out a tonne of interesting announcements. I was lucky enough to know about a few of the announcements in advance but I always watch the keynote (day 1, and day 2) anyway because there is always stuff that surprises me.

One of the announcements that did surprise me was the introduction of Visual Studio Code. Visual Studio Code is a lightweight cross platform code editor focused on helping developers write web-based applications. It is available on Windows, Mac OS X and Linux.

Visual Studio Code is not based on the same code-base that the other Visual Studio products are built upon (mostly a mixture of native C/C++ and .NET code). Instead, Visual Studio Code builds upon the awesome work that has gone into the Atom editor. Atom is a highly customisable editor and clearly Microsoft has been extending it to produce the look and feel that they want. Here is a picture of Atom (top) and Visual Studio Code (bottom) for comparison.

Atom

Visual Studio Code

If you are comfortable using Atom, then you'll be comfortable using Visual Studio Code, perhaps with one exception. It looks like Microsoft has gone out of their way to hide way the package system which is one of the things that makes Atom powerful. Hopefully that is just temporary as the figure things out.

Whilst I spend a lot of time working with .NET on Windows, over the last few years I've been increasingly interested in Node.js (and of course io.js). When I'm writing JavaScript targeting Node.js I tend to find myself using my MacBook Pro more so one of the first orders of business after installing Visual Studio Code to check it out was making it available in the path so I could easily start hacking on files in a directory that I am in with the Terminal.

In the past, with Atom I've created a link using the following command:

ln -s /Applications/Atom.app/Contents/MacOS/Atom ~/bin/atom  

So that from the Terminal I could issue the following command:

atom .  

Because Visual Studio Code is based on the same engine as Atom I figured the same technique would work, unfortunately the Visual Studio Code editor routinely crashed, so I ended up placing the following file in the ~/bin directory (named vsc).

#!/bin/sh
open -a Visual\ Studio\ Code.app $1  

Finally, you need to give that file execution permissions:

chmod +x vsc  

That did the trick for me, but your mileage may vary. I'm looking forward to giving Visual Studio Code a try. By the looks of it Microsoft is adding some significant value on top of Atom around debugging and IntelliSense support.