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

Fix a couple of newline issues #81

Merged
merged 3 commits into from
Feb 27, 2015
Merged

Conversation

jaredpar
Copy link
Member

The two HasNewLineBefore rules had a couple of small issues that needed
to be addressed.

  1. They were unconditionally using CRLF which could possibly lead to
    mixed line endings in files. The code was changed to prefer existing
    endings instead.
  2. They were formatting around #if blocks which is suspect and needs to
    be disabled.
  3. Produced new SyntaxNode values on trees that already had the correct
    formatting. This was potentially changing line endings and made it
    difficult to find noisy rules in the formatter.

After looking at the logic of these rules they appear to really just be
the same rule run against two different nodes. Hence I merged them into
a single rule to make it easier to share code.

The two HasNewLineBefore rules had a couple of small issues that needed
to be addressed.

1. They were unconditionally using CRLF which could possibly lead to
mixed line endings in files.  The code was changed to prefer existing
endings instead.
2. They were formatting around #if blocks which is suspect and needs to
be disabled.
3.  Produced new SyntaxNode values on trees that already had the correct
formatting.  This was potentially changing line endings and made it
difficult to find noisy rules in the formatter.

After looking at the logic of these rules they appear to really just be
the same rule run against two different nodes.  Hence I merged them into
a single rule to make it easier to share code.
@jaredpar
Copy link
Member Author

Merging this new because I found a more serious issue I need to fix that depends on this change. Even though I'm merging this now I will respond / update code based on any feedback left on this PR.

jaredpar added a commit that referenced this pull request Feb 27, 2015
Fix a couple of newline issues
@jaredpar jaredpar merged commit 36f8784 into dotnet:master Feb 27, 2015
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.

2 participants