LSP Demystified - How towrite an LSP server in Python
summary
Shows an actual Python LSP server that parses SQL with SQLFluff, speaks over JSON-RPC in stdio mode, and publishes diagnostics via textDocument/publishDiagnostics. Completion answers use the AST for context (table vs column) and include documentation and hover info; the server also runs and explains queries and executes them against a database. Deployment uses pip (pip install sql-lsp) and the implementation uses pygls; the client needs only a ~10‑line patch, not heavyweight editor plugins.
AI-written summary · about
chapters (15)
- 0:00LSP introduction
- 1:05Writing LSP server in Python
- 3:59Language Server Protocol
- 6:31Parsing code into an abstract syntax tree
- 7:53Linting errors with SQL fluff
- 10:01Smart autocomplete
- 12:11Adding docs to autocomplete
- 13:36LSP capabilities
- 15:24Live demo: SQL LSP
- 18:12Summary of implementation
- 18:56Q&A: distribution & testing
- 21:05Performance & debouncing
- 22:30GitHub repo & structure
- 23:56Extending LSP features
- 24:59Code actions for refactor
related talks
44mThe Language Server Protocol Why The Hype
30mImproving the development experience with language servers
31mGraal-LSP: A Language Server Implementation with Polyglot Support for the GraalVM
36mExperiences Building a Language Server Protocol Plugin
35mQuerying the queries: SQL Metaprogramming in Python
44mDeveloping a Language Plugin: LSP versus the Joy of Learning
01h 06mSunday Lightning Talks
39mTowards a Graphical Language Server Protocol for Diagrams?
