Separate method and constant reference Ruby APIs#719
Open
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
69d6496 to
44be2ea
Compare
This was referenced Apr 2, 2026
st0012
approved these changes
Apr 2, 2026
| end | ||
| end | ||
|
|
||
| def test_graph_resolved_constant_references |
Member
There was a problem hiding this comment.
Is it possible to have both resolved and unresolved references returned together? If so, can we add a test for it?
|
|
||
| // Constant and ConstantAlias have constant references | ||
| rb_define_method(cConstant, "references", rdxr_constant_declaration_references, 0); | ||
| rb_define_method(cConstantAlias, "references", rdxr_constant_declaration_references, 0); |
Morriar
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Another refactor PR preparing for exposing ancestor operations in the Ruby API. This PR separates method from constant references. They have different data and different types involved, so we can get better structure by having them be independent.
Other than internal changes, the main thing is that we now have:
ConstantReference: abstract parent classUnresolvedConstantReference: the object to represent constants that we couldn't resolve (holds unqualified name and location)ResolvedConstantReference: object for resolved constants (holds declaration that it points to and location)