From ba68bbf96516fd609c27961a7d124330cfa197e3 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Wed, 11 Dec 2024 10:47:44 +0100 Subject: [PATCH] fixed line break in type parameter constraint --- CHANGELOG.md | 1 + src/formatter/marker/MarkLineEnds.hx | 1 + .../simons_type_parameter_constraints.hxtest | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 test/testcases/lineends/simons_type_parameter_constraints.hxtest diff --git a/CHANGELOG.md b/CHANGELOG.md index fa79e10..cf677e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## dev branch / next version (1.x.x) - added indentOffset to support code snippets with non-zero indentation levels +- fixed line break in type parameter constraint ## version 1.17.1 (2024-10-22) diff --git a/src/formatter/marker/MarkLineEnds.hx b/src/formatter/marker/MarkLineEnds.hx index abc6819..99aa0c0 100644 --- a/src/formatter/marker/MarkLineEnds.hx +++ b/src/formatter/marker/MarkLineEnds.hx @@ -334,6 +334,7 @@ class MarkLineEnds extends MarkerBase { case Comma: case Semicolon: case Arrow: + case Binop(OpAnd): case Binop(OpAssign): case Binop(OpGt): case Const(CIdent("is")): diff --git a/test/testcases/lineends/simons_type_parameter_constraints.hxtest b/test/testcases/lineends/simons_type_parameter_constraints.hxtest new file mode 100644 index 0000000..9f06d7a --- /dev/null +++ b/test/testcases/lineends/simons_type_parameter_constraints.hxtest @@ -0,0 +1,14 @@ +{ +} + +--- + +function hasIdent(name:T):T { + return false; +} + +--- + +function hasIdent(name:T):T { + return false; +}