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

whitespace typeHintColonPolicy doesn't apply to enums and @:overload #488

Closed
jorisbinkies opened this issue Jun 7, 2019 · 0 comments
Closed
Labels
bug Something isn't working tokentree requires fix in tokentree whitespace missing or incorrect space around token

Comments

@jorisbinkies
Copy link

jorisbinkies commented Jun 7, 2019

Describe the bug

I have set "typeHintColonPolicy": "around", because we like the spaces between the variable, colon and typehint. However, this does not seem to be applied to arguments of enums. I also noticed it does not apply the whitespace to the return arguments of @:overloads (might be related to #184)

Input file

enum LoadState
{
	NotLoaded;
	Loaded;
	Loading(progress:Float);
}
extern class Angular
{
	@:overload(function(element:js.html.Element):AngularElement {})
	public static function element(name:String):AngularElement;
}

Broken output

enum LoadState
{
	NotLoaded;
	Loaded;
	Loading(progress:Float);
}
extern class Angular
{
	@:overload(function(element : js.html.Element):AngularElement {})
	public static function element(name : String) : AngularElement;
}

Expected output

enum LoadState
{
	NotLoaded;
	Loaded;
	Loading(progress : Float);
}
extern class Angular
{
	@:overload(function(element : js.html.Element) : AngularElement {})
	public static function element(name : String) : AngularElement;
}
@AlexHaxe AlexHaxe added bug Something isn't working whitespace missing or incorrect space around token labels Jun 7, 2019
AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Jun 7, 2019
@AlexHaxe AlexHaxe added the tokentree requires fix in tokentree label Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tokentree requires fix in tokentree whitespace missing or incorrect space around token
Projects
None yet
Development

No branches or pull requests

2 participants