Setting up LSP Config in Neovim for beautiful error diagnostics
What is LSP?
Language Server Protocol (LSP) is a protocol of communication between IDEs/code editors and servers that provide programming language specific features like code completion, refactoring(renaming variables) or navigating to a symbol’s definition, etc.
For non-members, click here to read the blog.
The problem that LSP solves
There are many code editors like Vim, VSCode, Atom, PyCharm, etc. There are things we expect from IDEs: features like code completion, navigating to definition, etc for each language. Before LSP was around, each IDE/code editor needed to add its implementation of the language-specific features. Most languages were tied to a given IDE or editor. If a new editor was developed, it needed to implement features like renaming variables or displaying squiggly lines for a possible error for every language. If a new language came around, it was difficult for it to be supported by all existing editors.
Now, that we have the Language Server protocol, we have two agents: an editor (client) and a language server (server). The server provides language-specific features like go-to-definition, find-references, hover, completion, rename, format, refactor, etc., using semantic whole-project…