Skip to content

Empty line formatting works differently in anonymous functions assigned to class variables or module level variables. #644

Closed
@basro

Description

@basro

Describe the bug

When anonymous functions are assigned to a module level field or a class field empty newlines are removed.
This doesn't happen if an anonymous function is assigned to a local variable inside of a function.
I was not able to find a setting specific for anonymous functions assigned to class fields so I assume this is a bug.

Input file

class Foo {
	var a = function() {
		1;

		2;
	}
}

var b = function() {
	1;

	2;
}

Broken output

class Foo {
	var a = function() {
		1;
		2;
	}
}

var b = function() {
	1;
	2;
}

Expected output
Empty lines should be preserved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingemptylinesmissing or incorrect empty line

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions