From 5fe0aa0063d0e22e13851cd3ae8e8293cbb1cdb4 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Sat, 16 Feb 2019 02:55:13 +0100 Subject: [PATCH] fixed indentation for anon function calls, fixes #315 fixed indentation of untyped assignment, fixes #326 --- CHANGELOG.md | 2 ++ .../issue_315_anon_function_call.hxtest | 22 +++++++++++++++++++ .../issue_326_untyped_assignment.hxtest | 22 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 test/testcases/indentation/issue_315_anon_function_call.hxtest create mode 100644 test/testcases/indentation/issue_326_untyped_assignment.hxtest diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a1e3f0..fa8a110f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ - Fixed braceless if body with conditionals, fixes [#328](https://github.com/HaxeCheckstyle/haxe-formatter/issues/328) ([#351](https://github.com/HaxeCheckstyle/haxe-formatter/issues/351)) - Fixed complex conditional typedef, fixes [#336](https://github.com/HaxeCheckstyle/haxe-formatter/issues/336) ([#351](https://github.com/HaxeCheckstyle/haxe-formatter/issues/351)) - Fixed parameter wrapping with multiline string, fixes [#320](https://github.com/HaxeCheckstyle/haxe-formatter/issues/320) ([#351](https://github.com/HaxeCheckstyle/haxe-formatter/issues/351)) +- Fixed indentation of untyped assignment, fixes [#326](https://github.com/HaxeCheckstyle/haxe-formatter/issues/326) +- Fixed indentation of anon function call, fixes [#315](https://github.com/HaxeCheckstyle/haxe-formatter/issues/315) ## version 1.4.0 (2019-02-07) diff --git a/test/testcases/indentation/issue_315_anon_function_call.hxtest b/test/testcases/indentation/issue_315_anon_function_call.hxtest new file mode 100644 index 00000000..45fb3582 --- /dev/null +++ b/test/testcases/indentation/issue_315_anon_function_call.hxtest @@ -0,0 +1,22 @@ +{ +} + +--- + +class Main { + static function main() { + context.subscriptions.push(Vscode.commands.registerCommand("hellohaxe.sayHello", function() { + Vscode.window.showInformationMessage("Hello from Haxe!"); + })); + } +} + +--- + +class Main { + static function main() { + context.subscriptions.push(Vscode.commands.registerCommand("hellohaxe.sayHello", function() { + Vscode.window.showInformationMessage("Hello from Haxe!"); + })); + } +} diff --git a/test/testcases/indentation/issue_326_untyped_assignment.hxtest b/test/testcases/indentation/issue_326_untyped_assignment.hxtest new file mode 100644 index 00000000..fe0e2ede --- /dev/null +++ b/test/testcases/indentation/issue_326_untyped_assignment.hxtest @@ -0,0 +1,22 @@ +{ +} + +--- + +class Main { + public static function main() { + (untyped foo).bar = function() { + trace(); + } + } +} + +--- + +class Main { + public static function main() { + (untyped foo).bar = function() { + trace(); + } + } +}