# Solargraph::Rspec

A Solargraph plugin that adds RSpec-aware code completion, jump-to-definition and type inference for Ruby projects, covering RSpec's describe/it blocks, memoized let helpers, custom matchers and several popular RSpec extensions.

Solargraph::Rspec extends the Solargraph language server with support for RSpec's dynamic, metaprogramming-heavy syntax, which Solargraph cannot infer on its own. It supports `describe` and `it` blocks, memoized `let`/`let!` helpers, `described_class` with correct type inference, implicit and explicit `subject`, and one-liner syntax such as `is_expected`.

It also recognizes core and third-party spec helpers and matchers, including rspec-mocks, rspec-rails, webmock, shoulda-matchers, rspec-sidekiq and airborne, and supports custom DSL extensions through configuration. Installation is a gem added alongside Solargraph and registered as a plugin in a project's `.solargraph.yml`.

The project recommends excluding the `spec/**/*` directory from Solargraph's pre-indexing to avoid performance issues; specs are still parsed on demand when opened in the editor. It also documents generating YARD documentation for installed gems so their methods appear in completions.

Website: https://github.com/lekemula/solargraph-rspec
