Skip to content

diangostic message have a wrong lf inside code block #17285

Open

Description

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer 0.0.0 (21ec8f5 2024-05-19)

rustc version: (eg. output of rustc -V)
rustc 1.80.0-nightly (ef0027897 2024-05-12)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
neovim

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
unrelated

repository link (if public, optional): (eg. rust-analyzer)
no need

code snippet to reproduce:

pub fn instance() {
    struct Point {
        x: f64,
        y: f64,
    }

    let box_point = Box::new(Point { x: 0.0, y: 0.0 });
    let unbox_point: Point = *box_point;
    assert_eq!(unbox_point, Point { x: 0.0, y: 0.0 });
}

the diangostic message have a wrong lf #[derive(PartialEq)]\n in codeblock

            location = {
              range = {
                ["end"] = {
                  character = 4,
                  line = 1
                },
                start = {
                  character = 4,
                  line = 1
                }
              },
              uri = "file:///Users/mw/workspace/foo/src/smart_pointer.rs"
            },
            message = "consider annotating `smart_pointer::instance::Point` with `#[derive(PartialEq)]`: `#[derive(PartialEq)]\n`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions