Language Server Protocol

Language Server Protocol

Language Server Protocol (LSP) is a protocol between a code editor and tools that understand code (language servers). Created by Microsoft and used heavily in Visual Studio Code.

A Language Server powers the editing experience for a programming language. It implements features such as: autocomplete, error-checking (diagnostics), jump-to-definition, and many other language features.

Without LSP: every editor (VS Code, Atom, Vim...) needs a custom integration for every language (JS, Python, Java...) — an M×N combinatorial problem.
With LSP: each language implements one Language Server (exposing completion, diagnostics, hover, formatting, definition, ...) that any LSP-compatible editor can talk to.

Since LSPs are often implemented in their own native language, cross-communication can be hard, so LSP solves this communication issue.

Why do code editors need to talk to Language Servers?

Related: Tools, Plugins