Skip to content

Rust formatter split some part of keyword to new line instead of continuing the line which can result in errors #19885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lulunac27a opened this issue May 28, 2025 · 3 comments
Labels
C-bug Category: bug

Comments

@lulunac27a
Copy link

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P) rust-analyzer version: 0.3.2474-standalone (d2f1787 2025-05-23) [/Users/lulu/.vscode/extensions/rust-lang.rust-analyzer-0.3.2474-darwin-arm64/server/rust-analyzer]

rustc version: (eg. output of rustc -V) rustc 1.87.0 (17067e9ac 2025-05-09) (Homebrew)

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) VSCode 1.100.2

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

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

code snippet to reproduce:

//this is a very long comment text to test the line length and ensure that it wraps correctly in the editor

Actual formatted output:

    //this is
         a very long comment text to 
       test the line leng
       th and ensure that
        it wraps correct
    ly in the editor

Some characters split into multiple lines even they are not full word which can result in errors after forrmatting this code

@lulunac27a lulunac27a added the C-bug Category: bug label May 28, 2025
@ShoyuVanilla
Copy link
Member

rust-analyzer doesn't do any kind of formatting and even rustfmt doesn't format such comments. I think that you might be using other kind of vscode extension that does such formatting

@ChayimFriedman2
Copy link
Contributor

I encountered this in the past when the editor was preparing. I think it's some kind of VFS bug.

@ShoyuVanilla
Copy link
Member

I encountered this in the past when the editor was preparing. I think it's some kind of VFS bug.

Oh, that's strange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants