# sorbet_view

> Extracts Ruby code from view templates (ERB, etc.) for Sorbet type-checking, with LSP support

Source: https://talira.ai/catalog/sorbet-view-9t5njasp
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [developer tools / type checking / templates](https://talira.ai/categories/developer-tools/type-checking/templates), [developer tools / type checking](https://talira.ai/categories/developer-tools/type-checking), [languages / ruby / rails](https://talira.ai/categories/languages/ruby/rails)
- Licence: MIT[^1][^2]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Self-hostable: yes
- Creator: kazzix14 (Kazuma)

sorbet_view is a Ruby gem that type-checks the Ruby inside Rails ERB templates with [Sorbet](https://talira.ai/catalog/sorbet-7qt3f670.md): it parses templates with [Herb](https://talira.ai/catalog/herb-q1h23fgr.md), writes typed Ruby files with a source map back to each template, and runs `srb tc` over them, so errors point at the right line of the `.erb` file. It also runs as a language server proxy, giving hover, completion and go-to-definition inside `.erb` files through its VS Code extension, and recompiles a controller's templates when the controller is saved. Partial locals are typed with `locals` and `locals_sig` magic comments, [ViewComponent](https://talira.ai/catalog/viewcomponent-v7yr5dbn.md) `erb_template` heredocs are compiled too, and a [Tapioca](https://talira.ai/catalog/tapioca-mqtavm7c.md) DSL compiler writes RBIs for helper methods and infers instance variable types from controller actions using srb_lens. It is a young one-developer project: its first release was in March 2026 and its latest (0.20.0) in July 2026.

## Links

- GitHub: https://github.com/kazzix14/sorbet_view

## Problems it solves

- Sorbet ignores the Ruby code in our Rails ERB views, so view bugs only show up at runtime
- get hover, autocomplete and go-to-definition for Ruby inside .erb files in VS Code
- type errors from view templates should point at the template line, not at generated code
- know the types of controller instance variables when type-checking the view that renders them
- type-check ViewComponent templates written as erb_template heredocs
- declare typed locals for Rails partials and get an error when a caller passes the wrong type
- run one command in CI that compiles our view templates and type-checks them

## Features

- compiles ERB templates to typed Ruby files and type-checks them with Sorbet (sv tc)
- source maps between templates and generated Ruby for error locations in the template
- LSP proxy server with hover, completion and go-to-definition in .erb files
- VS Code extension
- recompiles a controller's templates when the controller file is saved
- locals and locals_sig magic comments for typed partial locals
- ViewComponent erb_template heredoc support
- Tapioca DSL compiler for helper method RBIs and controller instance variable types (via srb_lens)
- uses Herb for fast ERB parsing
- YAML configuration: input and component directories, typed level, Sorbet options

## Capabilities

- Has a command line tool: plan not known
- Has official SDKs: plan not known

## Trust

Overall: 0.28 out of 1.
Signals: backing 0.20, extensibility 0.20.

- created by kazzix14 (Kazuma)

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [Sorbet](https://talira.ai/catalog/sorbet-7qt3f670.md)
- Works with [Tapioca](https://talira.ai/catalog/tapioca-mqtavm7c.md)
- Works with [Herb](https://talira.ai/catalog/herb-q1h23fgr.md)
- Works with [Ruby on Rails](https://talira.ai/catalog/ruby-on-rails-xkdcpj5k.md)
- Works with [ViewComponent](https://talira.ai/catalog/viewcomponent-v7yr5dbn.md)

## Alternatives

- [sorbet_erb](https://talira.ai/catalog/sorbet-erb-6v1r7dwc.md): Extracts Ruby code from ERB files so you can run Sorbet over them
- [Sorbet for Rails](https://talira.ai/catalog/sorbet-for-rails-gqfgx58c.md): A Sorbet build for Rails apps that type-checks specs, factories, and ERB views

## Sources

[^1]: https://github.com/kazzix14/sorbet_view/blob/main/LICENSE (checked 20 Nov 2026)
[^2]: https://rubygems.org/gems/sorbet_view (checked 20 Nov 2026)
