Enable configuration to selectively wrap some comments and leave others unwrapped
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
📋 Description
wrap_comments should have configuration to only wrap some comments and leave others untouched.
Currently the configuration feature wrap_comments will wrap both doc comments and normal comments. This is very desirable for doc comments where the purpose is for humans to read and understand the text. It's also very desirable for comments which aren't meant for documentation but instead describe the code for readers of the source.
Unfortunately, it's painful for another very common use of comments: disabling small sections of code temporarily. In particular, a large section of code which is at times near the column width will get re-wrapped as text if it's commented out and then reformatted. This can make it more challenging to temporarily disable a section of code.
It'd be nice to have an affordance for non-wrapped comments as well as wrapped comments. For instance, // comments could be unwrapped while /// and /* */ comments could be wrapped. The workflow here is best when the "unwrapped" comment is the same as whatever the user's editor applies to highlighted sections of text (which, for me using IntelliJ is //).
Other notes
- Depending on the implementation, there may be an interaction with
normalize_comments.
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 tracing the wrap_comments configuration and its interaction with normalize_comments; the issue does not name files or tests. Define the configuration behavior for wrapped and unwrapped comment forms, including the documented examples, and verify that each category is formatted as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100