rust-lang / rust-lang/rust-analyzer

Error tooltip wrapping at a weird spot

Open
#21,409 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Image

The line break before the backtick causes incorrect Markdown rendering.

The reason is that rust-analyzer responds with a \n before the backtick.

Steps to reproduce:

  1. Create a new project with cargo new.
  2. Rename src/main.rs with src/lib.rs.
  3. Override the contents of the file with this.

code snippet to reproduce:

mod front_of_house {
    pub mod hosting {
        pub fn add_to_waitlist() {}
    }
}

mod customer {
    pub fn eat_at_restaurant() {
        hosting::add_to_waitlist();
    }
}

rust-analyzer version: 0.3.2743

rustc version: rustc 1.91.1 (ed61e7d7e 2025-11-07)

editor or extension: VSCode

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

Reproduce the tooltip issue in VSCode using a cargo new project, rename src/main.rs to src/lib.rs, and use the provided Rust snippet. Start by tracing how rust-analyzer's error response is rendered when it contains a newline before a backtick. Done means the tooltip wraps normally and the Markdown backtick renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.