add a "references" relationship kind and referenceLocation mixin #59
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.
Bug/issue #, if applicable: rdar://108470705
Summary
This PR adds a new relationship kind,
references
, that describes a relationship where one symbol references another one in its implementation. It also introduces areferenceLocation
mixin for relationships that describes the source range where the reference occurs.The idea behind adding this information to a symbol graph would be to allow for more semantic analyses to be made on projects, for example to find unused symbols within a project. Including the source range also allows for a sort of "offline language server", by providing a data source for a "jump to definition" and "find references" functionality.
The JSON for these relationships would look like this:
Dependencies
None
Testing
This PR is being used as a baseline specification for future implementations, so demonstration symbol graphs need to be synthesized from whole cloth and cannot be tested in a straightforward manner.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded