rust-lang / rust-lang/rust-analyzer
Improve type hints for long/deeply nested types (parser combinators etc.)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Hello!
I'm the author of chumsky, a parser combinator crate. As I'm sure you know, parser combinators involve combining simple parsers together with the type system to produce parsers for more complex syntaxes.
Unfortunately, this can result in very large types that, although very useful to the compiler, are almost entirely useless for the programmer trying to work with them (each parser has a virtually identical API to any other, and so the type conveys no real meaning: only the traits that it implements matter).
I'm not personally a user of rust-analyzer, but I have a few users that are, and I've noticed that they're getting rather intrusive type annotations within combinator code, like so:

It would be great is there were a way to opt out of inline type hints (perhaps with an override) that could be controlled by crate developers. Perhaps it would be possible to have some sort of #[rust_analyzer(no_hint)] attribute that I can add to my combinator types that would be understood by rust-analyzer?
My apologies if this has already been requested: I checked existing issues already and was unable to find something similar.
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
The issue names no files, tests, or entry points. Start by reproducing the intrusive inline type hints described for chumsky-style parser combinators and review the existing rust-analyzer type-hint behavior; done means an agreed, documented way for crate developers to suppress or override these hints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100