WRITELOOP

LANGUAGE SERVER PROTOCOL ON VIM

2020 August 3

Language Server Protocol on Vim

LSP defines a protocol for communication between an editor/IDE and a language server, that provides language features like Code Completion, Go to Definition, Find All References, etc… There are client and servers on LSP. On vim we can use ALE (Asynchronous Language Engine) as a client, which is the most flexible I have found to date for this editor and works for python and bash, between others. Another alternative is vim-lsc, which is a vimscript implementation. Each language can have multiple servers. We must always check the features they implement. One way do discover that it to search for “LSP support table”. ALE as a LSP client supports the following (it’s on its' README.md):

  • Diagnostics (via Language Server Protocol linters)
  • Go To Definition (:ALEGoToDefinition)
  • Completion (Built in completion support, or with Deoplete)
  • Finding references (:ALEFindReferences)
  • Hover information (:ALEHover)
  • Symbol search (:ALESymbolSearch)