rust-lang / rust-lang/rust-analyzer

Heuristics for omitting parameter inlay hints are not documented nor are they configurable

Open
#17,433 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-config
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Right now, a parameter inlay hint is automatically omitted using a series of heuristics defined here. This isn't referenced in the documentation at all, and while useful, also cannot be tweaked or disabled.

As a result it can appear that inlay hints for parameters are broken, since quite frequently these heuristics will match and they will be omitted.

I think an appropriate resolution would be to both document the heuristics being used (something I'm planning to PR in a moment), and to allow disabling these heuristics. Ideally each heuristic could be individually disabled and/or configured but a global disable for the heuristic omission would also be ideal.

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 with crates/ide/src/inlay_hints/param_name.rs, especially the heuristics at lines 92-99, and trace where parameter inlay-hint settings are defined and documented. Document the current omission behavior and add a way to disable it, with the final scope of per-heuristic versus global configuration determined from the existing settings structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.