-
Notifications
You must be signed in to change notification settings - Fork 0
Code style
Use these settings to configure your code style for .hx
files. The style will be used in generated code and snippets.
Use haxe_fields_order
setting to specify the class structure. The available keys are:
Key | Description |
---|---|
V | Sorted static variables |
v | Sorted variables |
F | Sorted static methods |
f | Sorted methods |
Example.
"haxe_fields_order": "Fvf"
The fields will be generated in this order:
private static function fooA():Void {}
public static function fooB():Void {}
public static var barA:Int;
public var barB:Int;
private static var barC:Int;
private function fooC():Void {}
Use haxe_modifiers_order
setting to specify the preferred order of modifiers. The available keys are:
Key | Description |
---|---|
o | override |
p | private or public |
i | inline |
s | static |
Example.
"haxe_modifiers_order": "ospi"
Generated method will look like this:
static private inline function foo():Int {}
Use haxe_whitespace_style
and haxe_white_space2
settings to specify your preferred spaces style.
Example.
"haxe_whitespace_style": "function f (a : T<T> , b : T = null) : T->T;",
"haxe_whitespace_style2": "for(i in 0...5)"
Generated code will look like this:
function foo (a : String , b : Int) : Void {
for(i in 0...10) {}
}
Use haxe_brace_style
setting to specify the position of the opening brace and the keyword after the closing brace.
Example.
"haxe_brace_style" : "}\nelse\n{"
Generated code will look like this:
if (true)
{
// if
}
else
{
// else
}
Use haxe_bl_top
, haxe_bl_property
, haxe_bl_group
, haxe_bl_var
and haxe_bl_method
settings to specify the number of blank lines between code blocks. More