Skip to content

Conversation

tk0miya
Copy link
Collaborator

@tk0miya tk0miya commented Aug 23, 2025

As a preparation for LSP server, this integrates model_dependencies.rbs
to each model signatures.

With this change, the signature of dependencies will be separated to the
each RBS file of the model. It allows to rbs_rails to generate
signatures for models one by one, not only the whole of application. It
also helps the LSP server generate signatures on the fly.

Note: this contains #344 and #337.

So far, our testcases build RBS signatures from scratch every time.  It
is slow and unnecessary.

This introduces a mechanism to share the built signatures across tests.

Before:

```
Finished in 99.189478s, 0.2016 runs/s, 0.1815 assertions/s.

20 runs, 18 assertions, 0 failures, 0 errors, 0 skips
```

After:

```
Finished in 25.321047s, 0.7899 runs/s, 0.7109 assertions/s.

20 runs, 18 assertions, 0 failures, 0 errors, 0 skips
```
ActiveRecord::* and ActiveStorage::* are parts of Ruby on Rails, and
their types are distributed on the gem_rbs_collection repo.  Therefore,
there is no reason to generate types for them.
As a preparation for LSP server, this integrates model_dependencies.rbs
to each model signatures.

With this change, the signature of dependencies will be separated to the
each RBS file of the model.  It allows to rbs_rails to generate
signatures for models one by one, not only the whole of application.  It
also helps the LSP server generate signatures on the fly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant