-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I've been developing a rust units of measure library that does a lot of const generic wizardry to handle dimensional coherence checking and rescaling at compile time.
As part of this, I have a very substantial need to prettyprint highly-parameterized types in a human readable way. I've been doing this with a LSP plugin that wraps r-a, allowing me to intercept JSON messages and customize the appearance of my types within them. This has proven extremely useful:

The implementation here is dead simple - we search for Quantity<...>
with the right number of commas, and when we find it we use our existing prettyprint integration for Quantity
(e.g., the one hooked up to the display and debug traits) to handle rendering it to a human-readable form.
However, wrapping the r-a binary and intercepting the LSP messages is hacky and not very composable. It feels like this is a good opportunity for r-a to support a plugin API with a minimal json->json contract, so that integrations like this can be more easily used, and sensibly composed together.
I could write a draft of such a feature, but i figured i'd open an issue first and see what people think?