rust-lang / rust-lang/rust-analyzer

Inlay hints for rendering applicable marker traits

Open
#14,055 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-hover A-inlay-hints C-feature E-hard fun
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Wild idea but I think it would be nice to have something like the following:

struct Foo {
    field: Bar,
}

where we render inlay hint(s) to roughly get:

struct Foo /* implements Sized, Send, Sync, ... */{
    field: Bar,
}

for the applicable marker traits implemented by the struct.
Bit more tricky is the case where we have generics come into play, though given this is already dreamed up syntax and we can have hover tooltips for them to explain, something like the following might be good:

struct Foo<T> /* implements Sized, Send if T: Send, Sync if T: Sync, ... */{
    field: T,
}

we don't really have the things in place yet to do something like this though

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

The issue names no files, tests, or entry points. Start by reading the proposed Rust examples and the note about generic marker traits; the desired behavior and completion criteria would need to be defined before implementation.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.