You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, // csharpier-ignore works on the next node, but that's not a very good fit if you've got a long block of very terse code.
Take this block of Xamarin Forms animation, for example:
CSharpier expands this out a lot and makes it (arguably) more difficult to read. Because the ignore works at the node level, I can just surround my code in a set of braces, then ignore that, like so:
// csharpier-ignore{// ... my problematic code}
...but that's not ideal. From a practical standpoint, it introduces scoping issues, and from a more philosophical standpoint you're altering structure to accommodate a tool, rather than the other way around.
Something like being able to say // csharpier-disable followed by // csharpier-enable again would be nice. I can see that Prettier also has a block-level ignore, though apparently it's only really meant for file-level ignoring.
(Love this tool, though. Wonderfully fast, and kudos for shipping three extensions and an MSBuild NuGet)
The text was updated successfully, but these errors were encountered:
I think it makes sense to support a ranged style ignore. Prettier has a similar feature request that has been open for years - prettier/prettier#5287 and has a decent amount of interest. I'm wondering if it is difficult to implement and that is the reason it hasn't been added to prettier yet.
It seems like it wouldn't be horribly difficult to implement as long as the start and end of the ignore are at the same level.
I think these levels make the most sense as a starting point.
Members of CompilationUnitSyntax - may be different for new top level statements, may want to include usings, a namespace could be at the top so maybe members of NamespaceDeclarationSyntax too.
Members of BaseTypeDeclarationSyntax - I think that would cover everything that can be at the top level of interfaces, classes, records and structs.
Statements of BlockSyntax - I think that covers statements in methods, statements in ifs/elses/whiles etc.
* Initial POC for ranged ignore
closes#678
* Gettings ranged ignore working with members of types
* Adding more tests, fixing a minor issue
* formatting file
* Updating documents
Currently,
// csharpier-ignore
works on the next node, but that's not a very good fit if you've got a long block of very terse code.Take this block of Xamarin Forms animation, for example:
CSharpier expands this out a lot and makes it (arguably) more difficult to read. Because the ignore works at the node level, I can just surround my code in a set of braces, then ignore that, like so:
...but that's not ideal. From a practical standpoint, it introduces scoping issues, and from a more philosophical standpoint you're altering structure to accommodate a tool, rather than the other way around.
Something like being able to say
// csharpier-disable
followed by// csharpier-enable
again would be nice. I can see that Prettier also has a block-level ignore, though apparently it's only really meant for file-level ignoring.(Love this tool, though. Wonderfully fast, and kudos for shipping three extensions and an MSBuild NuGet)
The text was updated successfully, but these errors were encountered: