rust-lang / rust-lang/rust-analyzer
Custom type rendering support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
My library whippyunits (and upcoming linear algebra adapter whippyalgebra) makes extensive use of deep, not very human readable generics. To deal with this, I ship a LSP proxy that wraps the rust-analyzer binary, intercepting the JSON messages, sniffing out my types, and rewriting them into human readable form:
This works exceptionally well - it is hard to overstate how helpful it is to be able to look at the shape and semantics of a matrix on mouseover - but it is not composable and it requires an annoying installation for my users.
A proper r-a feature that allows this kind of text manipulation would be extremely useful. Even better if it allows customization of autofill behavior on double-click (my LSP proxy replaces verbose Quantity types with simple qty! macro invocations). There's no need to support particularly deep reflection/metaprogramming in the text transformation layer - you get very good results even if you just parse the literal string of the type that would be rendered, and re-render it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rust-analyzer binary and the JSON messages intercepted by the existing LSP proxy. Determine which rendered-type and double-click autofill behaviors would need a customization interface, then define a minimal composable design and verify it against the whippyunits examples described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100