Skip to content

Automatically move { opening braces down to a new line when pressing enterΒ #6834

@apotenza92

Description

@apotenza92

Hi all,
I've come across other older issues raised to have opening braces such as { automatically move down to the new line once enter is pressed and the cursor is inside the brace.
As far as I'm aware these were made before the more modern C# extension was created and are issues with the older Omnisharp LSP.

Describe the solution you would like

A setting for the VSCode C# Extension that allows for automatic moving of opening braces { to a newline.
This is the way it works in other C# editors like Visual Studio and Rider.

Applicable Scenarios

In what scenarios would the feature apply?

Currently:

class Car {*cursor here press enter*}

Results in the following after pressing enter:

class Car {
    *cursor here*
}

Proposed { setting enabled would result in the following after pressing enter:

class Car
{
    *cursor here*
}

Describe alternatives you've considered

The extension C# Curly Formatter achieves this but it should be a simple included option in the C# extension. This extension also has some issues conflicting with other extension such as Vim.

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