godot-gdscript-toolkit
godot-gdscript-toolkit copied to clipboard
Formatter adds extraneous newlines after annotations above functions
trafficstars
Currently, when a function has an annotation such as @warning_ignore written above it, gdformat will add newlines in between the function and the annotation.
Example input (which I would expect to be largely unchanged):
func okfunc() -> void:
pass
@warning_ignore("unused_parameter")
func testfunc(some_param: int) -> void:
pass
Current output:
func okfunc() -> void:
pass
@warning_ignore("unused_parameter")
func testfunc(some_param: int) -> void:
pass
Well, looks like @warning_ignore works with function headers now... I knew this day would come :) In short, @warning_ignore is treated as a standalone annotation for now and therefore it's separated from function in your example. Looks like it will have to be context-aware now.
Thanks for reporting!