The project is in a healthy, maintained state
Provides go-to-definition, completion, and hover for the partial name string of Rails render calls.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.26.0, < 0.27.0
 Project Readme

ruby-lsp-rails-partial

CI

A Ruby LSP add-on that understands the partial name string of Rails render calls and provides:

  • Go to definition — jump from render 'admin/areas/form' (or render partial: '...') to the matching partial file. When multiple formats match, all candidates are offered.
  • Completion — complete partial names while typing inside the string. Partials in the same directory are offered as bare names; others use the path form.
  • Hover — show the list of resolved partial files as Markdown links.

Bare names (render 'form') are resolved relative to the current view's directory, or to the controller name when called from a controller. Locale and variant qualifiers (_form.en.html.erb, _form.html+phone.erb) are treated as the same partial.

Installation

Add the gem to your application's Gemfile:

group :development do
  gem 'ruby-lsp-rails-partial', require: false
end

Then run bundle install and restart the Ruby LSP server in your editor. The add-on is discovered automatically by Ruby LSP via the lib/ruby_lsp/**/addon.rb convention.

Scope

The view root is fixed to app/views. prepend_view_path / append_view_path and independent engines are not supported.

Development

bundle install
bundle exec rake test

License

MIT