Embracing Ruby magic: Statically analyzing DSLs
summary
Ruby LSP now exposes an add-on API that lets gems teach the server how to understand declaration DSLs and call-site DSLs rather than hardcoding every framework, with an indexing enhancements surface that uses add_method/add_module/add_class to publish dynamic declarations discovered during a single AST traversal via a dispatcher and listeners for performance. Example behavior implemented: belongs_to creates reader and writer signatures in the index and validate symbols resolve to method definitions for command‑click go to definition. A working MCP server prototype surfaces that combined index to LLMs.
AI-written summary · about
chapters (11)
- 0:00Introduction and welcome
- 1:31Defining static analysis and DSLs
- 7:47Challenges in static analysis of DSLs
- 10:20Ruby LSP overview and features
- 12:27Add-on API for DSL integration
- 17:24Architecture of Ruby LSP
- 18:06Handling declaration DSLs
- 21:35Handling call site DSLs
- 26:12Community add-ons and MCP server
- 28:01Future ideas for Ruby type checking
- 30:28Conclusion and Q&A








