Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Added a rule to remove #region/#endregion directives. #194

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakesays-old
Copy link

Rule to remove regions.

return targetNode;
}

class RegionFinder : CSharpSyntaxWalker

This comment was marked as spam.

@terrajobst
Copy link
Member

LGTM

@jaredpar?


namespace Microsoft.DotNet.CodeFormatting.Rules
{
[SyntaxRule(RemoveRegionsRule.Name, RemoveRegionsRule.Description, SyntaxRuleOrder.RemoveRegionsRule)]

This comment was marked as spam.

@jaredpar
Copy link
Member

jaredpar commented Nov 7, 2015

I do think this needs to be off by default but other than that it looks good.

Had 1 Q about the trivia tracking. More out of curiosity than a correctness issue.

@jakesays-old
Copy link
Author

It was the only way I could find to go from the node to a SyntaxTrivia. It seems to work, but if there is a more correct way then I'll gladly change it.

How do I configure the rule to be off by default?

@jaredpar
Copy link
Member

jaredpar commented Nov 7, 2015

@JakeSays see the end of the attribute declaration here

https://github.com/dotnet/codeformatter/blob/master/src/Microsoft.DotNet.CodeFormatting/Rules/MarkReadonlyFieldsRule.cs#L19

Essentially DefaultRule = false is the current method.

Base automatically changed from master to main March 11, 2021 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants