Visual Studio Code update includes return of Unity support, now from Microsoft

Visual Studio Code update includes return of Unity support, now from Microsoft

Microsoft has updated Visual Studio Code (VS Code) to version 1.81, including support for partial profiles, an improved diff editor, smaller JavaScript bundle, and the return of Unity support.

The Unity game engine can be scripted with C#, with the primary editors being Visual Studio in both Windows and Mac guises. In June last year the Unity team confirmed what many developers already suspected, that the VS Code extension was deprecated. “This plugin was a result of one of our hackweek experiments by a few of our former employees. Unfortunately, it’s never been fully functional and hasn’t received any updates for almost two years, bringing you an unstable coding experience,” said the post, adding: “We will post updates here as we progress with the plan to officially end support for the Visual Studio Code plugin.” That news did not go down well with devs. “I am really, really sorry to hear about this. I think it is a terrible decision. Visual Studio Code has become the de facto editor for most devs I work with,” said one.

Now an official Unity extension is back, but this time from Microsoft rather than from Unity. According to principal software engineer Jb Evain, the new extension, in preview, depends on features added to VS Code via the C# Dev Kit, which improves .NET support but requires a paid license for enterprise use. It seems that the C# Dev Kit, which shares technology with full Visual Studio, makes it easier to adapt Visual Studio’s Unity support for VS Code. Evain is careful to describe Visual Studio as Microsoft’s “premier C# development tool.”

Although the commercial status of the C# Dev Kit has been controversial, since it undermines the free and open source aspect of VS Code, it does seem to have enabled Microsoft to come to terms with how it sits alongside Visual Studio. Despite Evain’s comments, VS Code does have advantages over Visual Studio, with its cross-platform support and a larger range of extensions.

The new Unity extension for VS Code (Image from Microsoft)
The new Unity extension for VS Code (Image from Microsoft)

Unity devs have mixed reactions to the new preview. “Significantly better than the last Unity extension and works as expected (and way faster too!),” said one; while another found the update “really disappointing me and completely disrupting my work.” It is a preview though, already has over 10,000 installs, and is rated at four out of five stars, ahead of the old effort which has just two stars.

The new VS Code update has the usual host of improvements, one being that the size of the shipped JavaScript has reduced by 20 percent or 3.9 MB, improving startup time. “All it took was a new build step: name mangling,” said VS Code team member Matt Bierner, though there were complications as he describes.

Another change in VS Code is partial profiles, which enable developers to customize some settings while applying others from a default profile.

There are also changes in the diff editor, used to find the changes between two similar files. First, a new diff algorithm, previously in preview, is now the default. There is also a new diff editor, which is not yet the default, but can be enabled in settings. The new editor can collapse unchanged regions, align text within diff regions, and uses the new algorithm to “reduce the probability of matching unrelated words,” says the team. That post is the place to look for full details of these and other enhancements.