Skip to content

Kate Language Server Protocol Client

Sunday, 28 April 2019 | Christoph Cullmann

The Language Server Protocol (LSP) allows the integration of stuff like code completion, jump to definition, symbol search and more into an application without manual re-implementation for each language one wants to support. LSP doesn’t fully allow an integration like KDevelop or Qt Creator do with the libclang based tooling aimed for C/C++ but on the other side offers the possibility to interface with plenty of languages without a large effort on the client side.

If one takes a look at some current LSP clients list, a lot of editors and IDEs have joined the LSP family in the last years.

In the past I was always scared away to start implementing this in Kate, as no readily available library was around to do the low-level work for the client. Whereas you get some reference stuff for the JSON based protocol for JavaScript and such, for Qt nothing was around.

Fortunately Qt Creator started to implement an LSP client beginning with the 4.8 release.

Based on this code, I started now to get this into the Kate project plugin. At the moment not much more has happened then some initial import of the Qt Creator LSP infrastructure code into the Kate lsp branch.

If I get this working (help is welcome!), any improvements will be submitted back to the Qt Creator implementation. If it really starts to work well in Kate, one might think about some better code sharing in the long term. But before such plans, first at least some basic things must work for some initial language server like clangd.