Skip to content

Keep scope braces next to loop braces with static foreach #607

@0xEAB

Description

@0xEAB

static foreach does not introduce a new scope on its own; instead one has to add a nested set of braces.
Currently, dfmt splits them which wastes a good amount of screen space and might look a bit odd.

Current format

static foreach (item; items)
{
	{
		// code here
	}
}
static foreach (item; items) {
	{
		// code here
	}
}

Idea

I’d prefer to have the scope braces right next to the loop braces.

static foreach (item; items)
{{
	// code here
}}
static foreach (item; items) {{
	// code here
}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions