Skip to content

fix LSP: Go to Definition on nn.Module calls should navigate to forward() #5229 - #5238

Closed
asukaminato0721 wants to merge 3 commits into
facebook:mainfrom
asukaminato0721:5229
Closed

asukaminato0721 wants to merge 3 commits into
facebook:mainfrom
asukaminato0721:5229

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

PyTorch module calls now navigate to forward(), including inherited and overridden methods. Explicit __call__ navigation still works.

Fixes #5229

  • I am a human, and I fully understand the code I am submitting.

Test Plan

add test

@github-actions

This comment has been minimized.

@stroxler stroxler left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks pretty good to me, thanks!

Can we just extract the special-case logic into a helper? I feel like it's too fiddly and specific to be inlining into the main match

@github-actions

This comment has been minimized.

@stroxler

Copy link
Copy Markdown
Contributor

I think this looks good. Could you try one more rebase? We had an outage in the auto-importer, I think it should be cleared now

@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D125585686. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 631f81e Oct 16, 2026
@meta-codesync meta-codesync Bot added the Merged label Oct 16, 2026
@meta-codesync

meta-codesync Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 631f81e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP: Go to Definition on nn.Module calls should navigate to forward()

2 participants