Skip to content

Application of formatting rules changed in 1.0.0.0-beta2 #23

@sharwell

Description

@sharwell

One of the StyleCop analyzers we implemented (SA1408) adds parentheses around certain expressions in code. The code fix provider implementation does not use Formatter.Annotation, and we have a unit test which verifies the code fix does not alter existing formatting aside from adding ( and ) characters.

The unit test in question was successful in the Beta 1 code. With no change aside from updating to Beta 2, the test now fails.

Here is the affected expression as produced by Beta 1:

bool z = z ? (true&&true)||false :false;

Here is the affected expression as produced by Beta 2:

bool z = z ? (true && true) || false :false;

The two expressions differ by a total of 4 space characters.

Questions:

  • ❓ Is there a way to cause Beta 2 to behave like Beta 1? Our diagnostics and code fixes relate specifically to code formatting so they will not work if the implementation changes unrelated formatting.
  • ❓ Was the behavior change in Beta 2 intended, and/or will it be reverted in the next release?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions