haxe-formatter icon indicating copy to clipboard operation
haxe-formatter copied to clipboard

Wrapping with assignment of multi-line string literal

Open Gama11 opened this issue 5 years ago • 2 comments

I feel like if there's an empty after a multi-line string assignment, it should be kept:

class Main {
	static function main() {
		var whileBackward =
'var i = $field;
while (i-- > 0) {
	$0
}';
	}
}

Removing it makes it look much worse:

class Main {
	static function main() {
		var whileBackward = 'var i = $field;
while (i-- > 0) {
	$0
}';
	}
}

Doesn't necessarily have to be a var assignment, could also appear in other value places:

class Main {
	static function main() {
		{
			foo:
'var i = $field;
while (i-- > 0) {
	$0
}'
		}
	}
}

Gama11 avatar Apr 07 '19 19:04 Gama11

keeping the line break before multi line strings is doable, but currently that would lead to indentation of its first line, which is probably not much better.

AlexHaxe avatar May 16 '19 10:05 AlexHaxe

Hm, yeah, that doesn't seem like a good idea.

Gama11 avatar May 16 '19 10:05 Gama11