packagemain.tech

packagemain.tech

Understanding the Language Server Protocol

LSP: the secret weapon of modern code editors.

Alex Pliutau's avatar
Alex Pliutau
Jan 02, 2025
∙ Paid

In the past, many code editors were built just for the specific language, and to provide rich and smart code editing, tight integration between the editor and the language tooling was a must. On the other hand, there were (and still are) more general-purpose editors, but they lacked in functionality when it came to more advanced language-specific features like code completion, “go to definition”, etc. (for example, code highlighting was done using the regular expressions).

With growing amount of code editors and programming languages this became the classic M*N complexity problem.

But then Microsoft introduced the Language Server Protocol (LSP) as a solution to the problem above, which elegantly transforms this M*N complexity into a more manageable M+N situation.

The LSP was initially driven by the needs of VS Code

  • LSP separates language servers from code editors (language clients). By making language servers independent processes dedicated to language understanding, the LSP enables any editor to utilize a standard language server. Which means that a single standard language server can be used by all editors.

  • This interoperability is achieved through a defined set of standard messages and procedures that govern communication between language servers and editors. The LSP defines the format of the messages sent using JSON-RPC between the development tool and the language server.

Modern-day code editors using LSP

User's avatar

Continue reading this post for free, courtesy of Alex Pliutau.

Or purchase a paid subscription.
© 2026 Aliaksandr Pliutau · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture