Understanding Language Server Protocol - autocomplete, formatting
summary
Shows how to implement a real Language Server in Go that reads/writes stdio JSON-RPC messages, implements a multiplexer for methods vs notifications, and wires initialize/DidOpen/DidChange for diagnostics and completion. Demonstrates using gopls as a backend proxy for a templating language so positions remap correctly, runs in Neovim/VS Code/JetBrains, and logs to a file. Includes a unit-tested parser and the passer library for incremental parsing; the example LSP and template proxy are functional and available as sample code.
AI-written summary · about
chapters (18)
- 0:00Introduction to LSP
- 1:04Protocol functionality
- 2:53LSP data transmission
- 4:26Message structure
- 7:11Notifications and flow
- 8:21Implementing the server
- 12:38Building a multiplexer
- 15:19Processing messages
- 17:22Initialization handshake
- 20:43Document synchronization
- 24:31Editor integration
- 28:45Building a custom server
- 31:14Diagnostics and parsing
- 36:04Autocomplete implementation
- 39:55Logging and debugging
- 41:48Advanced LSP techniques
- 44:51Introspection and parsing
- 48:09Conclusion and resources








