`wrap_comments` can break up code snippets
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
Very related to #5244 -- not sure if this should be merged with that. Either way, a similar behavior occurs with code snippets in comments. Given the following...
/// This is a comment with some code `foo bar`.
If the comment reaches the maximum width inside the code snippet, it'll break it up like so:
/// This is a comment with some code `foo
/// bar`
I think it would be more expected for it to treat the snippet as a single lexeme, and insert the line break prior to the start (foo).
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
Reproduce the reported behavior with wrap_comments enabled and a comment containing the inline code snippet foo bar near the maximum width. Trace the comment-wrapping logic and confirm that the completed behavior keeps the snippet together and moves the line break before foo; compare the related discussion in issue #5244.
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
- 45/100