A walkthrough of building a custom Ruby LSP add-on that adds 'go to definition' support for Rails view partials. Covers LSP mechanics (JSON-RPC messaging), the add-on architecture, and how to use Prism's AST dispatcher to identify render calls in ERB templates and resolve the corresponding partial file paths. The author submitted the full implementation as a pull request to the official ruby-lsp-rails add-on.

7m read timeFrom janko.io
Post cover image
Table of contents
LSP mechanicsCustom add-onPrism drillingReturning locationsClosing words

Sort: