News

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

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube