rust-lang / rust-lang/rust-analyzer

Limit length for type inlays

Open
#4,151 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-inlay-hints S-actionable
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:

Screenshot from 2020-04-26 14-26-39

It would be better to add an option to limit the length of the type inlays, and display the remaining portion as ....

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.