ty icon indicating copy to clipboard operation
ty copied to clipboard

Is it possible to shorten/truncate inlay type hints for unions (in Zed)?

Open toddpocuca opened this issue 1 month ago • 2 comments

Question

I work with JAX and often libraries in the ecosystem will accept/return many objects because of types like ArrayTree or ArrayLike, which are long unions and produce type hints like:

Image

Is there any way to shorten the number of union elements included in the inlay hints?

Version

ty 0.0.2 (42835578d 2025-12-16)

toddpocuca avatar Dec 16 '25 23:12 toddpocuca

Hmm yeah that's a bit much in this case, we should consider more aggressive heuristics for truncating these things in multi-assigns.

Gankra avatar Dec 16 '25 23:12 Gankra

Treating PEP-613 aliases as first-class opaque types and just referring to them with the alias names (rather than eagerly expanding the values of the aliases) would probably help a lot here. Similar to #1883

AlexWaygood avatar Dec 16 '25 23:12 AlexWaygood