Create a Server

Learn By Building: Language Server Protocol

Learn By Building: Language Server Protocol

#Learn #Building #Language #Server #Protocol

“TJ DeVries”

In this video, we build an entire Language Server from an empty Go project with literally no dependencies. Along the way, we’ll use Go’s standard library, builtin unit testing and Neovim to learn the most effective way that I know – by building something. There’s no “Fill in the rest of the owl” – it’s each step along the way. Hopefully by the end you really understand what’s happening with Language Servers

Leave a like or comment, and subscribe of course! 😉

Repo Link:
Neovim: Neovim btw

00:00:00 – Introduction
00:00:50 – Read the Friendly Manual
00:01:44 – Transport Mechanism
00:03:02 – RPC Encode
00:05:39 – RPC Encode Test
00:08:15 – RPC Decode
00:12:27 – RPC Decode Test
00:13:38 – Decoding Method
00:17:18 – Decoding Content
00:18:04 – Building
00:18:58 – Building main.go
00:20:50 – Split Function
00:21:49 – Split Function Impl
00:25:49 – Logging
00:28:35 – Add basic Logging
00:29:16 – VERY FIRST MESSAGE
00:32:24 – Server life cycle
00:39:19 – More decoding
00:41:32 – Decoding Initialize
00:46:08 – Initialize Response
00:52:06 – Language Server Things
00:53:17 – Text Document Synchronization
00:56:18 – Start of “compiler”
01:02:22 – Start of “Analysis”
01:05:11 – Syncing State
01:10:25…

source

 

To see the full content, share this page by clicking one of the buttons below

Related Articles

33 Comments

  1. I know you were doing this all manually as a teaching exercise but CoPilot is so good for at converting these JSON schemas into Go structs. Saves so much dang time

  2. Last year I tried to build a bridge between nvim-dap and powershell dap server to make them communicate over named pipes, which nvim-dap didn't support at the time. I learned a lot but in the end it was a bridge too far.. Dap seems to be quite similar to lsp

  3. I expectec to write the comment "I wish you ignored the chat, and focused on the thing you are doing," and saw that there is not chat. Cool!

  4. I am only 35 mins in but this is absolute gold. Not necessarily in terms of the specifics of building an LSP… I mean it's great, but how many of us are actually gonna need to build an LSP from scratch … but just in terms of problem solving, how to approach learning something, and how to de-mystify a topic. This 2 hour video must have taken your weeks of research and practice. Really appreciate all that hard work and then sharing it with us all.

  5. love this. I built a LSP server last year to help validate & format our custom PR body requirements in a markdown file locally rather than waiting on CI. Totally silly project but the point was to learn LSPs.

Leave a Reply