belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 98 forks source link

Comments are not automatically wrapped. #1352

Open make1980 opened 1 month ago

make1980 commented 1 month ago

Single line/multi line comments are not automatically wrapped/checked by csharpier.

Input:

// Test very long line comment.
// Second line of long comment.
var someVariable = someValue;

Width = 10

Output:

// Test very long line comment.
// Second line of long comment.
var someVariable = someValue;

Expected behavior:

// Test
// very
// long
// line
// comment.
// Second
// line
// of
// long
// comment.
var someVariable =
    someValue;
belav commented 1 month ago

I'm not opposed to this, but it may be a lot of work. Prettier has had the request for 7 years now - https://github.com/prettier/prettier/issues/265

That also brings up some points about potential issues. ascii diagrams, table-formatted text, etc.

make1980 commented 1 month ago

I have a PR for this - will publish to get feedbacks. https://github.com/belav/csharpier/pull/1355

make1980 commented 1 month ago

.assign

Hona commented 4 weeks ago

I feel like this would break far too many things, than the few things it would help.