Should wrapping comments be a job for the formatter? #874
Replies: 1 comment 1 reply
-
Just noticed I missed this thread, sorry about that. I've been thinking about comments wrapping before, and more generally just about overall formatting of comments. My previous stance was that formatting comments was just not worth it, given that it could contain completely arbitrary text, and we might mess things up here. But, I think a good balance might be to format documentation comments (#851 (comment)). I'm not sure if there is a unified consensus on what a documentation comment is though, but I think there are some general rules we could apply:
All of this is assuming comments formatting would be easy to introduce, which I'm not sure about 😅. My main thing is whether we have enough context, or whether it would be invasive to introduce that context. I think it should be doable if we wanted to, the relevant code in |
Beta Was this translation helpful? Give feedback.
-
Comments are useful for documentation or to explain niche situations - the latter being my common use case for them - and wondered if hard line-wrapping comments according to StyLua's line width property was ever a feature to be considered.
In VS Code there's already an extension that handles this that I use, though I'm wondering what tool should be responsible for this - the editor or extensions, and whether it can/should be handed over to formatters i.e StyLua?
Beta Was this translation helpful? Give feedback.
All reactions