Skip to content

fix Find-references on library/third-party code #1399 - #4194

Open
asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:1399
Open

asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:1399

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1399

Find References from third-party .py source now searches references indexed against its matching .pyi stub.
Preserves the source declaration and merges workspace references.

Test Plan

add test

@github-actions

This comment has been minimized.

@meta-codesync

meta-codesync Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@asukaminato0721
asukaminato0721 force-pushed the 1399 branch 2 times, most recently from 535950d to 743115d Compare October 27, 2026 11:29
@github-actions github-actions Bot added size/l and removed size/l labels Oct 27, 2026
@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.

Thanks! This looks like a promising direction. I think there are a couple of gaps:

  • Include the stub declaration when renaming. Renaming a symbol from its .py source must update the corresponding .pyi declaration along with consumers. Keep declaration suppression specific to Find References, and add a paired-file rename test.
  • Validate lexical scope before mapping source symbols to stubs. Only map actual module-level or class-level declarations—not parameters, local variables, or nested functions that happen to share a public symbol’s name. Add negative tests for these name collisions.

@github-actions github-actions Bot added size/xl and removed size/l labels Oct 30, 2026
@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. ✅

This branch has not been deployed

No deployments
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.

Find-references on library/third-party code

3 participants