rust-lang / rust-lang/rust-analyzer
Limit length for type inlays
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Some embedded device crates use generated codes and the type can get very long, such as the stm32f1xx_hal::stm32::Peripherals struct.
In VSCode, the type inlay would become something like this when you type:

It would be better to add an option to limit the length of the type inlays, and display the remaining portion as ....
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 by locating rust-analyzer's type-inlay rendering and configuration entry points, then trace how VSCode displays the resulting inlay text. Add a configurable length limit with an ellipsis for truncated types, and verify the behavior with the existing inlay tests or in VSCode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100