Skip to content

Line comment right after else #316

Closed
@Gama11

Description

@Gama11

Describe the bug

The expectation here is probably that the comment stays where it is.

Input file

class Main
{
	public static function main()
	{
		if (foo)
		{
			bar;
		}
		else // comment
		{
			bar;
		}
	}
}

Broken output

class Main
{
	public static function main()
	{
		if (foo)
		{
			bar;
		}
		else
			// comment
		{
			bar;
		}
	}
}

Optional: hxformat.json

{
	"lineEnds": {
		"leftCurly": "both"
	},
	"sameLine": {
		"ifElse": "next"
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsamelinebroken same line formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions