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

// csharpier-ignore #581

Closed
dlech opened this issue Jan 30, 2022 · 5 comments · Fixed by #584
Closed

// csharpier-ignore #581

dlech opened this issue Jan 30, 2022 · 5 comments · Fixed by #584
Labels
Milestone

Comments

@dlech
Copy link
Contributor

dlech commented Jan 30, 2022

There are some cases where initializers have super-long lists of arguments. It would be helpful to have the equivalent of // prettier-ignore to handle these cases.

@belav belav added area:formatting type:enhancement New feature or request labels Jan 30, 2022
@respel
Copy link

respel commented Jan 31, 2022

@dlech Can you list the scenarios you were having issues with? Maybe we can use that to improve csharpier itself.

One is tabular arrays and functions arguments that the prettier example gives.

@dlech
Copy link
Contributor Author

dlech commented Jan 31, 2022

Yes, arrays like this: https://github.com/dlech/SshAgentLib/blob/07c4d17f6648d13378dee274ebc8efa3c9b78144/SshAgentLib/Crypto/BCrypt.cs#L355

It makes for way too much scrolling when each item is on a new line.

@respel
Copy link

respel commented Jan 31, 2022

I like what google-java-format does. They have an exception for tabular arrays to keep the original formatting.

This is in line with the no-options philosophy. Although if we go this route, this might not be the only exception we'd need to add. So much more work.

@belav
Copy link
Owner

belav commented Jan 31, 2022

I think it makes sense to support // csharpier-ignore for edge cases like this. After noodling on it for the last day I think it may be pretty easy to implement if is is only supported at specific levels.
Meaning support it on members of classes, statements in methods, etc.
But do not support in on arguments in invocations, the 8th invocation in a long chain, etc.
Playing around with prettier just now, I think prettier works that way.

I created #583 because even with support for ignoring lines, I think it may make sense to leave tabular initializers alone.

@belav
Copy link
Owner

belav commented Feb 9, 2022

0.15.0 is out now with the support for // csharpier-ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants