-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Ignore and decorators #848
Comments
CSharpier-ignore (and ranges) only works in some contexts because there was no generic way to implement it. I started with the basic cases and planned on expanding support as people ran into other areas that it made sense so be able to ignore. The ignore-start in the first example is probably a leading trivia on the method itself, so the current code is expecting the end to appear somewhere else within the members of the class. But the nodes for the attribute are children of the method declaration. I may just leave that as is if it isn't an easy fix. The range ignore code is a bit messy if I remember correctly. In the second example csharpier doesn't look for ignores on attribute nodes, so the only place it ends up working is before the first attribute because that is considered leading trivia of the method declaration. That then results in no formatting on the attributes nor on the method. I'll work on getting it to behave like this // csharpier-ignore - only the first attribute
[Attribute ]
[Attribute]
public void MethodThatShouldFormat() { }
[Attribute]
// csharpier-ignore - only the second attribute
[Attribute ]
public void MethodThatShouldFormat() { }
[Attribute]
[Attribute]
// csharpier-ignore - just the method
public void MethodThatShouldFormat( ) { } |
Hi (again),
In a Xunit test class, I wanted to ignore formatting on decorators because it made the class unnecessarily ugly.
However,
// csharpier-ignore
seem to have no effect and ranged ignore seem to disable formatting for the rest of the document.I guess ignore on decorators isn't implemented yet, is it ?
Here is some sample code I played with in the playground :
Without ignore, makes the result really long
With ranged ignore, doesn't format the method
With single-line ignore, doesn't have any effect
The text was updated successfully, but these errors were encountered: