Skip to content
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

Multiline comments are not properly indented. #580

Closed
dlech opened this issue Jan 30, 2022 · 1 comment · Fixed by #582
Closed

Multiline comments are not properly indented. #580

dlech opened this issue Jan 30, 2022 · 1 comment · Fixed by #582
Labels
area:formatting type:bug Something isn't working
Milestone

Comments

@dlech
Copy link
Contributor

dlech commented Jan 30, 2022

I was hoping to use csharpier on a code base that currently uses 2 space indents. One thing I noticed right away is that the indentation of multiline comments is not handled correctly. Only the first line in indented and the rest of the lines remain where they were. This applies to both xml doc comments and C-style comments.

Actual:

image

Should be:

image

Actual:

image

Should be:

image

As a workaround, I used dotnet format first, then dotnet csharpier.

@belav belav added area:formatting type:bug Something isn't working labels Jan 30, 2022
belav added a commit that referenced this issue Jan 30, 2022
@belav belav added this to the 0.15.0 milestone Jan 30, 2022
belav added a commit that referenced this issue Feb 5, 2022
@belav belav closed this as completed in #582 Feb 5, 2022
belav added a commit that referenced this issue Feb 5, 2022
…582)

* Handle multiline comments better

closes #580

* Adding a test case. Starting to handle the extra indent in /* style comments.

* Getting test passing

* Fixing validation logic

* Update DocPrinter.cs

* Update Token.cs

* Handling another edge case

* Cleaning up some code

* Code review change
belav added a commit that referenced this issue Feb 8, 2022
belav added a commit that referenced this issue Feb 8, 2022
@belav
Copy link
Owner

belav commented Feb 9, 2022

This is working for /// style comments in 0.15.0. My solution for /* style comments was not playing nice with commented out code and I haven't found a good solution yet. I created #606 to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:formatting type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants