Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haxe code formatter #1003

Closed
markknol opened this issue Dec 15, 2015 · 8 comments · Fixed by #1118
Closed

Haxe code formatter #1003

markknol opened this issue Dec 15, 2015 · 8 comments · Fixed by #1118

Comments

@markknol
Copy link
Contributor

Can there be a code formatter implemented for the Haxe?

Maybe this project can be converted to a commandline tool (using neko) to be able to format Haxe code?
https://github.com/dpeek/haxeprinter

@Neverbirth
Copy link
Contributor

Didn't the old code formatter work for Haxe as well? I seem to remind so, and in that case when Mika upgraded it he removed support for Haxe but could be added again?

At any rate, is that project really working for every case? At a first glance I'm not completely sure, nor it seems to be very configurable, but maybe I'm wrong.

This more Mika's area. People around here would also be interested on having this.

@markknol
Copy link
Contributor Author

I dont know it has some options. I don't know if it is any good too :)

I don't know if the old code formatter didn't work, it is disabled in my version.

@elsassph
Copy link
Member

The AS3 code formatter doesn't support Haxe. We need a reliable tool to use for that, it's the main issue.

@Meychi
Copy link
Member

Meychi commented Dec 16, 2015

I could integrate a formatter if there would be a good one available.

@markknol
Copy link
Contributor Author

I tried the haxeprinter, it was out of date. This will make the project work again. dpeek/haxeprinter#9

These are the options you have in the configuration file:

{
    "cuddle_method_braces":false,
    "cuddle_type_braces":false,
    "empty_line_after_import":false,
    "empty_line_after_package":true,
    "empty_line_before_type":true,
    "empty_line_between_enum_constructors":false,
    "empty_line_between_fields":true,
    "empty_line_between_typedef_fields":false,
    "extends_on_newline":false,
    "function_arg_on_newline":false,
    "implements_on_newline":false,
    "inline_empty_braces":false,
    "maximum_line_length":100,
    "modifier_order":["override", "public", "private", "static", "extern", "dynamic", "inline", "macro"],
    "print_root_package":false,
    "remove_private_field_modifier":false,
    "space_after_structure_colon":false,
    "space_after_type_hint_colon":false,
    "space_around_function_arg_assign":false,
    "space_around_property_assign":true,
    "space_around_typedef_assign":true,
    "space_before_structure_colon":false,
    "space_before_type_hint_colon":false,
    "space_between_anon_type_fields":true,
    "space_between_enum_constructor_args":false,
    "space_between_function_args":true,
    "space_between_property_get_set":true,
    "space_between_type_param_constraints":true,
    "space_between_type_params":true
}

The application can be build/called with neko. It worked pretty good as far I've tested.

@Meychi
Copy link
Member

Meychi commented Dec 16, 2015

I will have a look at this.

@markknol
Copy link
Contributor Author

Great! Looking forward to this one; It will make the editor even more complete! 👍

I saw in the repo this is also being used by HIDE (also a Haxe editor)

Meychi added a commit that referenced this issue Mar 9, 2016
- CodeFormatter now follows main settings (tab/space size and code style)
- AStyle code formatter integrated for CPP and other C like languages (JS, Haxe, C# etc... :), closes #1003
- Flex PMD related fixes, ruleset creator is now hosted at fd.org
@markknol
Copy link
Contributor Author

Hey this sounds awesome, Im looking forward to test this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants