Skip to content

[Bug]: csharpier-ignore comment removes linespaces before block #1867

Closed

Description

@OleRoss

Description

When I use // csharpier-ignore, the newline before the ignore comment is always removed. I would expect it to follow the same rules applied when the comment is not there.

Steps to Reproduce

void X(){
    int i = 1;


    int x=1;


    // csharpier-ignore
    int y=1;
}

Expected Behavior

The new line should be preserved:

void X()
{
    int i = 1;

    int x = 1;

    // csharpier-ignore
    int y=1;
}

Actual Behavior

The new line is removed:

void X()
{
    int i = 1;

    int x = 1;
    // csharpier-ignore
    int y=1;
}

Activity

  1. JimmyCushnie commented on Jun 4, 2026

    @JimmyCushnie
    Contributor

    I've been running into this bug, it's pretty frustrating. It also happens with // csharpier-ignore-start comments.

  2. added 2 commits that reference this issue on Jun 4, 2026
    7912fdc
    d21f902
  3. added this to the 1.3.0 milestone on Jun 5, 2026
  4. added a commit that references this issue on Jun 5, 2026
    bc8987b
  5. OleRoss commented on Jun 5, 2026

    @OleRoss
    Author

    thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions