So, when you put it together, it's not too surprising that Microsoft and its open-source partners have created the Language Server Protocol (LSP). The LSP is a collaborative effort to provide a common way to integrate programming languages across code editors and integrated development environments (IDEs). The protocol extends developer flexibility and productivity by enabling a rich editing experience within a variety of tools for different programming languages.
"Historically, most programming languages have only been optimized for a single tool. This has prevented developers from using the editors they know and love, and has limited opportunities for language providers to reach a wide audience," said Tyler Jewell, Codenvy CEO and Eclipse Che project lead. Jewell continued, "With a common protocol supported by Microsoft, Red Hat, and Codenvy, developers can gain access to intelligence for any language within their favorite tools."
LSP is designed to promote interoperability between editors and language servers. The protocol also enables developers to access intelligent programming language assistants. These include such functions as: Find by symbol, syntax analysis, code completion, go to definition, outlining, and refactoring with their editor or IDE of choice.
At the moment, LSP supports the following languages: C++, PowerShell, JSON, CSS/LESS/SASS, Xtext, Crane PHP, Haxe, Java, and RAML. As for IDEs, currently, Microsoft Visual Studio Code and Eclipse Che have already implemented the protocol. Eclipse Che's implementation is pending in an open source branch and will be generally available within Q3.
"We have defined the common language server protocol after integrating the OmniSharp for C# and TypeScript servers into VS Code," said Erich Gamma, Microsoft Distinguished Engineer. "Having done a language server integration twice, it became obvious that a common protocol is a win-win for both tool and language providers. In this way, any language provider can make their language support available so that it is easily consumable by any tool provider."
The language server protocol collaboration enables:
Developer flexibility and choice: Developers can access rich editing experiences across new programming languages, while continuing to use their preferred tools.
Multiple operating systems: Programming language providers can support multiple tools across a variety of operating systems, maximizing their reach and relevance.
Editor support: Microsoft Visual Studio Code and Eclipse Che, the next-generation Eclipse IDE, have added support for the protocol.
Many supported programming languages: Besides the programming language servers available today, more language servers are planned to support the protocol later this year. These include C# by the OmniSharp project, xText and R by Typefox, JavaFX by Ensime and CSS by Microsoft. Red Hat has open sourced a project working to provide the first standalone Java language server which it proposes to donate to the Eclipse Foundation.
Open collaboration: Codenvy, Microsoft and Red Hat are committed to developing this protocol in collaboration with the open source community. Hosted on a public repository, anyone can submit feedback or contribute pull requests to enhance and refine the project.
Language server registry: Language servers are published as part of a global registry, built by Codenvy as an Eclipse project and hosted by the Eclipse Foundation, to make language servers discoverable for any tool to consume.