Add Type Server Protocol (TSP) support for ty
This adds TSP (Type Server Protocol) support to ty, enabling external
consumers like Pylance to use ty as a type provider via a JSON-RPC protocol.
New crates:
- tsp_types: Protocol type definitions (requests, responses, type representations)
- tsp_ty_server: TSP server implementation wrapping ty_server via extension traits
Changes to existing crates:
- ty_ide: Added type_info module with public APIs for type information queries
- ty_server: Added RequestExtension/Notifier traits for server extensibility,
exposed session and server internals needed by TSP
The TSP server communicates over stdin/stdout using JSON-RPC 2.0 and supports:
- Version handshake and capability negotiation
- Snapshot-based consistency model
- Expression type queries (inferred, declared, expected types)
- Import resolution and search path queries
- Type stub generation for synthesized types
- Typeshed content serving
[ty] Fix state synchronization bug with nested workspaces and changed files
This fixes an issue where when we removed a workspace folder, it was
possible for the state of an open file to become stale. We try to fix
this here by forcing the file to be re-synchronized with disk.