namespacesindentationriderc#-10.0

Jetbrains Rider: Prevent Indentation in file-scoped namespace


I am trying to make Rider not indent my c# code that is within a file-scoped namespace, because currently what Rider does, both when creating a new class and when reformatting existing code is the following:

namespace PreviewNamespace ;

    public class C
    {
    }

and i would want (also notice the whitespace between the namespace and the semicolon)

namespace PreviewNamespace;

public class C
{
}

What i tried so far:

Maybe it's just me and i need a clean installation of Rider or i'm just blind and completely missed a setting for this.

Either way, any help is greatly appreciated!

Cheers


Solution

  • I managed to figure out what caused this issue for me with a side-by-side setting comparison thanks to mu88's comments:

    Under Editor>Code Style> C#> Other I had the box Revert to old formatting engine (Resharper Other-section) ticked, unticking it resolved the issue.

    I hope this helps anyone that also has the same issue.

    EDIT: I also just noticed, that when Revert to old formatting engine is ticked, the checkbox Braces Layout > Indent inside namespace declaration (for me at least) changes nothing in the preview below.