News

Visual Studio IDE Opens Up to More Programming Languages

Visual Studio developers who want to program in non-native languages can now write their own extensions to do so with new support (in preview) for the Language Server Protocol.

The Language Server Protocol (LSP) is an open source project from Microsoft that provides server-based "language smartness" to client tools such as the VS IDE. That smartness includes functionality such as source code auto-completion, Go To Definition, Find All References and so on.

The protocol lets developers enjoy some of the same functionality that comes baked in to the IDE for natively supported languages such as C#, C++, F#, Visual Basic, JavaScript and TypeScript. To do that, developers can create their own LSP-based extensions for the language of their choice using that language's server (if one is available).

Microsoft summarized the new LSP client tool -- which comes as an extension itself -- thusly:

The Language Server Protocol (LSP) is a common protocol that provides language service features to developer tools. A language server contains the deep understanding of a specific language while the Language Server Protocol provides the communication between the language server and the developer tool. The complex logic of a language server needs to be implemented only once and then from there, smaller pieces of code can be written to allow the language server to talk to the specific developer tool. This allows for a consistent editing experience for any tool that supports the protocol.

One such tool that already supports the protocol is Visual Studio Code, Microsoft's open source, cross-platform code editor. As a popular (more than 1 million downloads) example of what that support enables, Red Hat has authored an LSP-enabled extension to provide Java support in VS Code, aptly titled "Language Support for Java by Red Hat," available in the Visual Studio Code marketplace. The tool uses the Eclipse JDT Language Server implementation of the LSP.

Now, the ability to create the same kinds of extensions for their favorite languages in the full-fledged IDE has excited some developers, as evidenced by a Reddit thread discussing building an extension to provide support for the Rust programming language in Visual Studio.

How the Language Server Protocol Works
[Click on image for larger view.] How the Language Server Protocol Works (source: Microsoft).

And there was already widespread excitement for the LSP even before the new client tool was announced, as evidenced by last month's article on the Kichwa Coders ("Eclipse Experts for Embedded Tools Solutions") site titled "The Language Server Protocol Will Revolutionize How You Code."

To get in on the excitement and author their own extensions, developers need to install the Visual Studio extension development workload on Visual Studio 2017 Preview.

"For the preview, you will have to declare a dependency on the Language Protocol Client Preview extension," Microsoft said. "This means that any customers who wish to install your language server extension must also have the Language Server Protocol Client preview extension installed first."

The new LSP extension, provided by Microsoft DevLabs, has been installed 120 times as of this writing, receiving no reviews or ratings yet.

The source code for Microsoft's LSP project is available on GitHub, where the project has garnered 2,142 stars, with 38 contributors.

Also available on GitHub is a Language Server Protocol Sample that provides a mock language server using the LSP and a mock language client extension in Visual Studio.

Further guidance is provided in documentation titled "Adding a Language Server Protocol Extension," along with specific client and protocol API documentation.

Microsoft said it hopes to collect developer feedback on the experimental preview, via comments on the LSP extension page or via e-mail at [email protected].

About the Author

David Ramel is an editor and writer at Converge 360.

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