rust-lang / rust-lang/rust-analyzer

Show only the first line of documentation on hover

Open
#22,823 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Suggestion

Add an option, for example rust-analyzer.hover.documentation.briefOnly, to shrink the displayed documentation in the hover pop-up to just the first line.

My Expirience

Typically, most crates use doc comments to provide full-page documentation about. This includes a lot of useful information, examples, and more. However, popup windows are usually too small to display all that stuff. Therefore, I would prefer to see only the first line of the documentation when I hover over an item. All other information could be accessed from a "Open Documentation" button or smth.

State Of The Art

The rustdoc tutorial suggests writing doc comments in such a way that the first line introduces "a short explaining sentence, what it is". This information should be easily accessible when users hover over the code.

https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#documenting-components

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 or tests. Start by locating rust-analyzer's hover documentation rendering and related configuration options, then determine how the first documentation line and a way to access the full text should be represented. Done means the new option produces brief hover documentation while preserving access to the complete documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.