diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe13ead..843a3fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## dev branch / next version (1.x.x) +## version 1.8.0 (2019-06-13) + - Added `sameLine.returnBodySingleLine`, fixes [#303](https://github.com/HaxeCheckstyle/haxe-formatter/issues/303) ([#483](https://github.com/HaxeCheckstyle/haxe-formatter/issues/483)) - Added `emptyLines.*.existingBetweenFields`, fixes [#455](https://github.com/HaxeCheckstyle/haxe-formatter/issues/455) ([#484](https://github.com/HaxeCheckstyle/haxe-formatter/issues/484)) - Added printing config filename in verbose mode, fixes [#460](https://github.com/HaxeCheckstyle/haxe-formatter/issues/460) ([#493](https://github.com/HaxeCheckstyle/haxe-formatter/issues/493)) @@ -19,6 +21,7 @@ - Fixed nested inline array comprehension, fixes [#498](https://github.com/HaxeCheckstyle/haxe-formatter/issues/498) ([#501](https://github.com/HaxeCheckstyle/haxe-formatter/issues/501)) - Fixed incorrect comment closing, fixes [#500](https://github.com/HaxeCheckstyle/haxe-formatter/issues/500) ([#501](https://github.com/HaxeCheckstyle/haxe-formatter/issues/501)) - Fixed imports with conditionals, fixes [#504](https://github.com/HaxeCheckstyle/haxe-formatter/issues/504) ([#505](https://github.com/HaxeCheckstyle/haxe-formatter/issues/505)) +- Fixed line break in type parameters, fixes [#494](https://github.com/HaxeCheckstyle/haxe-formatter/issues/494) ([#507](https://github.com/HaxeCheckstyle/haxe-formatter/issues/507)) - Changed `sameLine.returnBody` to only apply to multiline or loop/switch/try/if expressions, fixes [#303](https://github.com/HaxeCheckstyle/haxe-formatter/issues/303) ([#483](https://github.com/HaxeCheckstyle/haxe-formatter/issues/483)) ## version 1.7.1 (2019-06-01) diff --git a/haxelib.json b/haxelib.json index 404a6d03..0ea0f40d 100644 --- a/haxelib.json +++ b/haxelib.json @@ -8,8 +8,8 @@ "style" ], "description": "A code formatter for Haxe", - "version": "1.7.1", - "releasenote": "Bugfixes - see CHANGELOG for details.", + "version": "1.8.0", + "releasenote": "Added same line options, empty lines options and an indentation setting for case labels and bugfixes - see CHANGELOG for details.", "contributors": [ "AlexHaxe", "Gama11" diff --git a/package.json b/package.json index 31bd0e4f..3e0e2251 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haxe-formatter", - "version": "1.7.1", + "version": "1.8.0", "description": "A code formatter for Haxe", "repository": { "type": "git", diff --git a/src/formatter/marker/wrapping/MarkWrappingBase.hx b/src/formatter/marker/wrapping/MarkWrappingBase.hx index 0aa57d2f..58db82c8 100644 --- a/src/formatter/marker/wrapping/MarkWrappingBase.hx +++ b/src/formatter/marker/wrapping/MarkWrappingBase.hx @@ -621,6 +621,11 @@ class MarkWrappingBase extends MarkerBase { return endToken; } switch (next.token.tok) { + case Binop(OpGt): + if (next.token.access().parent().is(Binop(OpLt)).exists()) { + return endToken; + } + return findItemEnd(next.token); case Binop(_): return findItemEnd(next.token); case CommentLine(_), Comment(_): diff --git a/test/testcases/wrapping/issue_494_type_parameter.hxtest b/test/testcases/wrapping/issue_494_type_parameter.hxtest new file mode 100644 index 00000000..51858c9f --- /dev/null +++ b/test/testcases/wrapping/issue_494_type_parameter.hxtest @@ -0,0 +1,17 @@ +{} + +--- + +typedef HaxeRequestMethod = RequestMethod; +typedef HaxeRequestMethod = RequestMethod; + +typedef HaxeNotificationMethod = NotificationMethod; + +--- + +typedef HaxeRequestMethod = RequestMethod; + +typedef HaxeRequestMethod = RequestMethod; + +typedef HaxeNotificationMethod = NotificationMethod;