Visual Studio 15 Preview Comes with Salsa

Why does Visual Studio need a JavaScript language service? The Visual Studio team explains in a blog post that it comes down to better JavaScript coding efficiency.

The Visual Studio team is previewing a new feature in Visual Studio "15" that will allow more efficient JavaScript coding. It's available through what's called a JavaScript language service, which the team is calling "Salsa" for now.

So, what's a JavaScript language service and what makes this feature so important from a VS developer's perspective? It has to do with coding efficiency. You don't notice it much if you're writring up C# code in plain old vanilla Visual Studio's IDE, but there are tools like IntelliSense and tool tips and the whole range of tooling features that pop up to assist you in writing that code. To get a similar efficiency while writing JavaScript in the VS IDE, it takes a new engine.

"Essentially, as you typed, a JavaScript engine constantly executed your code to provide "runtime-like" accuracy in completion lists, signature help, and other tooling features," writes Bowden Kelly, a Microsoft Program Manager, in a blog post. "The execution engine was great for handling the more dynamic aspects of the language, however, it also introduced significant complexity and inconsistency," he added.

The issue seems to be even more evident when running long code, which can tend to time out the execution engine as it encountered nested loops or http requests, notes Kelly.

That's where Salsa comes in, which Kelly says uses " the same static analysis that provides type inference in TypeScript."

Why static and not dynamic analysis? Kelly explains: "First, static analysis provides a consistent experience for JavaScript across all Visual Studio setups by eliminating runtime bailouts. Second, JavaScript editing experiences can benefit from existing TypeScript definition to provide richer IntelliSense. Third, JavaScript inherits support for features from ES2015, ES2016 and beyond that currently exist in TypeScript."

Kelly notes in his blog that Salsa needs to be enabled, since it's not available by default. As Salsa gets more refined, he said to expect an improved automatic type acquisition feature, as well as support for @constructor and @typedef in the JSDoc specs. And of course, the team is always looking for participation and feedback.

Salsa is available in the Visual Studio 15 Preview here.

About the Author

You Tell 'Em, Readers: If you've read this far, know that Michael Domingo, Visual Studio Magazine Editor in Chief, is here to serve you, dear readers, and wants to get you the information you so richly deserve. What news, content, topics, issues do you want to see covered in Visual Studio Magazine? He's listening at [email protected].

comments powered by Disqus