Repository navigation
Add optional Jedi definition metadata provider - #1488
Aschenbath wants to merge 8 commits into
Conversation
|
Hi @Aschenbath! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
Add
JediDefinitionProviderfor resolving Python definitions without a running Pyre server, as proposed in #451.NameandAttributenodes receive immutableJediDefinitionsnapshots; calls with those callees receive the same definitions. The results describe inferred definitions, not expression return types or complete type annotations.The provider integrates with
FullRepoManager, analyzes the wrapper's current source, and keeps only pickleable paths in the manager cache. Jedi loads lazily through the optionallibcst[jedi]extra. Provider resolutions are serialized across threads because Jedi uses shared parser state. Documentation includes usage, supported nodes, environment and syntax limitations, and timeout behavior.Fixes #451.
Test Plan
TypeInferenceProvidertests passed separately. Fixture regeneration leaves no diff. Source coverage is 95.7%.Local runtime validation used Linux CPython 3.12 and the native parser from the released LibCST 1.9.0 musllinux wheel; the native parser was not rebuilt from this checkout. Both Jedi 0.19.2 and 0.20.1 were exercised. Fork Actions have produced no runs, so the wider OS/interpreter matrix is still unverified.
AI assistance: OpenAI Codex implemented and tested this change, with independent review by a separate Codex agent. No human code review is claimed.