Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correctly emit references for Command#call #232

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

varungandhi-src
Copy link
Contributor

@varungandhi-src varungandhi-src commented Jan 13, 2025

Fixes GRAPH-895.

There are two ways to fix this issue, by emitting a definition
for the synthetic class method generated by Sorbet in rewriter/Command.cc,
as well as emitting a reference for that; OR merely changing
the reference emitting logic to also have a special case
(similar to rewriter/Command.cc). I've picked the second option.

As of now, I don't understand which part of the Sorbet logic
is responsible for making sure that the synthetic method does
not show up when using findMethodTransitive which we're
using for name lookup. So it makes sense to make the simpler
change here.

Sourcegraph colleagues can see a series of Loom recordings here
on my thought process during debugging and fixing this issue.

Test plan

Added snapshot tests.

# ^^^^^^^ reference [..] Opus#MyThing#
# ^^^^^^^ reference [..] Opus#MyThing#Command#
# ^^^^^^^^ reference [..] Opus#MyThing#Command#GetThing#
# ^^^^ reference [..] Opus#MyThing#Command#GetThing#call().
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line indicates the bug-fix.

@varungandhi-src varungandhi-src merged commit bfbaa15 into scip-ruby/master Jan 13, 2025
2 checks passed
@varungandhi-src varungandhi-src deleted the vg/fix-Command#call branch January 13, 2025 08:57
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