-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect indentation on a multi-line statement split by comments #968
Labels
Milestone
Comments
I'm not clear why both lines end up with no indentation, a similar case is only missing the indentation on the first line... although this case is a chain of method calls, while yours is just a single method call. var delay =
// Adding a small buffer to the reset time reduces the chance of getting
// rate limited again, because it allows for more requests to be released.
CallSomeMethod(resetAfterDelay.Value + TimeSpan.FromSeconds(1))
// Sometimes Discord returns an absurdly high value for the reset time, which
// is not actually enforced by the server. So we cap it at a reasonable value.
.Clamp(TimeSpan.Zero, TimeSpan.FromSeconds(60)); In case you weren't aware, you can bypass the formatting with // csharpier-ignore
var delay =
// Adding a small buffer to the reset time reduces the chance of getting
// rate limited again, because it allows for more requests to be released.
(resetAfterDelay.Value + TimeSpan.FromSeconds(1))
// Sometimes Discord returns an absurdly high value for the reset time, which
// is not actually enforced by the server. So we cap it at a reasonable value.
.Clamp(TimeSpan.Zero, TimeSpan.FromSeconds(60)); |
belav
added a commit
that referenced
this issue
Dec 26, 2023
shocklateboy92
added a commit
that referenced
this issue
Jan 9, 2024
* fixing an edge case with comments on variable declarations closes #968 * self code review --------- Co-authored-by: Lasath Fernando <devel@lasath.org>
This was referenced Jan 15, 2024
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
I have the following snippet. It has the expected formatting already:
As you can see, it's an assignment statement that's split over multiple lines with comments in the middle.
CSharpier formats it like so (indentation is lost):
I do think it's a bug because all lines except the first should be indented. I suspect the issue may be in the presence of comments, but I can't test it because if I remove the comments then the lines get reformatted in a completely different way:
The text was updated successfully, but these errors were encountered: