Skip to content

Commit 97a5b4e

Browse files
Anqi Wumeta-codesync[bot]
authored andcommitted
Add structured type query responses
Summary: Expose a structured response for type query results so clients can consume type names, arguments, callables, and variables without parsing display strings. The response keeps `display` as a compatibility field for existing string-based behavior and includes a top-level `version` field so the schema can evolve without adding another endpoint. The structured conversion intentionally maps Pyrefly's internal type enum into a smaller client-facing shape: `named`, `callable`, and `variable`. The conversion remains exhaustive over `pyrefly_types::types::Type`, so adding a new Pyrefly type variant requires an explicit mapping at compile time. `display` is still present for compatibility and debugging. It can be removed or gated in a later schema version once consumers no longer depend on the legacy string representation. Reviewed By: stroxler Differential Revision: D105329981 fbshipit-source-id: 4aabc97679fb4cf3d3e8321401d4b9337ac22dee
1 parent 92413ec commit 97a5b4e

2 files changed

Lines changed: 578 additions & 16 deletions

File tree

0 commit comments

Comments
 (0)