You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make Graph#index_source language_id optional (#841)
## Problem
`Graph#index_source` currently requires callers to always pass a
`language_id`, even though Rubydex can infer the language from the URI
in the same way file indexing does. This makes callers repeat
extension-based dispatch logic and adds friction for common in-memory
indexing paths.
This follows from the API discussion in
https://github.com/shop/world/pull/775250/changes#r3325323365.
## Changes
- Made the Ruby API accept an omitted or `nil` `language_id`.
- Moved language inference for omitted `language_id` into the Rust FFI
boundary, defaulting `.rbs` URIs to RBS and everything else to Ruby.
- Updated the RBI signature and `index_source` tests to cover inference,
explicit overrides, invalid language IDs, and the resulting graph
declarations.
```ruby
# Before
graph.index_source(uri, source, language_id)
# After
graph.index_source(uri, source)
graph.index_source(uri, source, language_id) # explicit override still works
```
0 commit comments