Skip to content

Specialize reference IDs#699

Open
vinistock wants to merge 1 commit into03-26-remove_reference_diagnostics_from_documentsfrom
03-26-specialize_reference_ids
Open

Specialize reference IDs#699
vinistock wants to merge 1 commit into03-26-remove_reference_diagnostics_from_documentsfrom
03-26-specialize_reference_ids

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented Mar 26, 2026

As I started trying to improve our Ruby API for references, I realized that a lot about is a bit weird at the moment. I will try to improve the type safety and quality as part of better exposing references in the API.

This PR ensures that we have specialized reference IDs for each declaration entity. It does not make sense to have a Constant declaration with a MethodReference associated to it, so this change prevents that from happening.

It does mean that we need to narrow types in a few places, but I think that's an acceptable trade-off for much better type safety.

Note: we don't yet index global, class or instance variable references. I already added the IDs because it's easier to make this refactor with proper types. Also, we do need to index those references too, so this is a change towards that as well.

Copy link
Copy Markdown
Member Author

vinistock commented Mar 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this Mar 26, 2026
@vinistock vinistock marked this pull request as ready for review March 26, 2026 15:24
@vinistock vinistock requested a review from a team as a code owner March 26, 2026 15:24
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