Skip to content
0:00 / 0:00

#lsp#languageserverprotocol#go

Learn By Building: Language Server Protocol

TJ DeVries

119K subscribers • 4 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by TJ DeVries
  • Linked in the descriptiontjdevries/educationalsp

Intermediate. Assumes working knowledge.

132K views2 years ago2 recommendations

Programming languagesTools and practiceGoVim, Emacs and editorsTesting

TJ DeVries builds a Language Server Protocol server from scratch in Go without dependencies, demonstrating JSON-RPC encoding and decoding.

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: github.com/tjdevries/educationalsp Neovim: Neovim btw - Introduction - Read the Friendly Manual - Transport Mechanism - RPC Encode - RPC Encode Test - RPC Decode - RPC Decode Test - Decoding Method - Decoding Content - Building - Building main.go - Split Function - Split Function Impl - Logging - Add basic Logging - VERY FIRST MESSAGE - Server life cycle - More decoding - Decoding Initialize - Initialize Response - Language Server Things - Text Document Synchronization - Start of "compiler" - Start of "Analysis" - Syncing State - Changing Documents - Hover Structu - First Hover Response - Making Hover Interactive - Goto Definition - Code Actions Demo - Code Actions Explained - Completion - Diagnostics - Conclusion ### Links Twitch: twitch.tv/teej_dv Twitter: twitter.com/teej_dv Github: github.com/tjdevries

Why it's here

2 people recommend this

What people say. Recommended as a great entry-level introduction to implementing the Language Server Protocol from scratch.

u/cxzukin r/ProgrammingLanguages • Recommends

On “January 2025 monthly "What are you working on?" thread”

I found TJs Learn By Building: Language Server Protocol video a great broad stroke entry-level into LSPs if you're unsure where to start. Its 2 hours and is more food for thought than a tutorial, but I liked it because it lightly touches on all the core LSP things you're probably interested in implementing. You still need to plumb it into your language and provide real data back via the protocol. Congrats on getting married! ✌

u/meni04in r/ProgrammingLanguages • Recommends

On “Need help implementing a language server for my project”

I loved tj series

u/cxzukin r/ProgrammingLanguages • Mentions

On “Advice? Adding LSP to my language”

Hi Aalstromm, Highly recommend getting the LSP in place as soon as you can. It will influence the shape of your code. A quick comment on syntax highlighting. I've no idea how Pygment works (its probably similar) - but VSCode has its own Tokenizer that takes in a TextMate grammar description. Your personal Go lexer will not be involved. There is something called Semantic Highlighting which goes through the LSP but will most likely use the AST depending on your language. I would personally put semantic highlighting low on the todo list. 1) IMHO - My first step would be to give Learn By Building: Language Server Protocol by TJ DeVries a watch. Its a broad stroke overview of the LSP imple…