rust-lang / rust-lang/rust-analyzer
Rust formatter split some part of keyword to new line instead of continuing the line which can result in errors
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 69
Description
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 (d2f17873ff 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the formatting of the long Rust comment shown in the issue with the reported rust-analyzer and rustc versions. Trace the formatter behavior responsible for splitting words and verify the fix by confirming that formatting preserves complete words and produces valid Rust source.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100