Well… We wrote a book on Language Server.

Nipuna Marcus
3 min readDec 4, 2021

--

I’m very excited to announce that I and Nadeeshaan wrote our first book on language server protocol and how to implement your own language server.

Book name is : Language Server Protocol and Implementation

You can find this on Amazon and Apress.

Cover of the book

As this was a really exciting journey of achieving one of the milestones of my life I would like to share it with you all. Following is our journey of becoming an author.

Why did we decide to write a book?

Well, all this began a few years back when we were researching tooling for WSO2’s Programming language Ballerina and looking for ways to improve our own visual editor and plugins we had (VSCode and IDEA). Then we found out about Language Server Protocol and there were few usages but very little written content on this. So we had to read the LS Protocol, look at the examples provided in the documentation and look at other implementations mentioned on the LSP official page and understand how we can write our own tooling backend which we will be able to reuse in LSP supported or unsupported IDEs.

So we kept improving our Language Server and working with our language compiler team to improve compiler APIs to support tooling. Once we get a point where we understood most of the language server, it’s usages and what are the best designs we decided to write a few blogs explaining parts of language server and how to start implementing a simple language server as there were fewer documentation on this.

Views we got on blogs proved people are interested in LSP and using this in there tooling developments. So we decided to write a book on this subject and go more in to details of the implementation of language server for Ballerina language and explain more on how to develop each language feature. We got in touch with Apress with a help of a mentor of ours and proceed with the proposal for the book and within one year or so we go the book published. :D

Who is this book for?

This book is written for developers who are passionate about programming language tooling and trying to implement tools to improve language smartness in IDEs and Editors that you like. you didn’t have to know about the language server to start reading this book as this book will guide you through the beginner level to advance feature development with language server.

What can be learned from this book?

well I copied this straight from the book :D

1. Implement a language server from scratch.

2. Understand language server protocol and its data models.

3. Leverage the protocol while preserving the unique user experience of different editors.

4. Extend the protocol to support more than its standard capabilities.

5. Run a language server on top of launchers such as standard I/O and TCP socket.

6. Seamlessly incorporate language semantics into your protocol features.

Finally …

It was not an easy task as writing a blog though. We had to carefully place what we should put in each chapters and how chapters should progress as to the maturity of the knowledge given by the previous chapter taking the reader from beginner level to advance level.

Also time wise we used most of our free time on this hence massive thanks to both of our families for the immense support they’ve given us.

We are very thankful for the Apress team who was involved in this project and supported us, two new guys who were trying to write their new book, from beginning to the stage of publishing the book.

Also i would like to thanks Nadeeshaan who dragged me in to language server development in the first place and beign a passionate co-author. This wouldn’t be a success without your dedication.

Finally, we would like to thank Kasun Indrasiri for being an inspiration for us and supporting us to achieve this milestone.

--

--

Nipuna Marcus
Nipuna Marcus

Written by Nipuna Marcus

Software Engineer at Zuhlke, Ex Tech Lead at WSO2, Author of “Language Server Protocol and Implementation”

No responses yet