Skip to content

Add a blank line between a namespace and a class declaration when creating new item #65921

@DoctorKrolic

Description

@DoctorKrolic

Version Used:
17.5 Preview 1

Steps to Reproduce:

  1. Create new console app
  2. Add the folowing .editorconfig:
[*.cs]
csharp_style_namespace_declarations=file_scoped:suggestion
  1. Right click on projet -> Add -> New Item
  2. Use the full view and select Class there. Name it Item.cs
  3. Observe generated class file

Expected Behavior:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestCSApp;

internal class Item
{
}

Actual Behavior:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestCSApp;
internal class Item
{
}

The fact, that there is no line between namespace TestCSApp; and internal class Item is extremely frustrating. I have to add it manually every single time!

I don't know if this issue really belongs to roslyn. Just placed it here based on the fact, that this thing needs to know code style options to generate the file. Feel free to move it to the relevant project if I am wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions