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

Formatter adds extraneous newlines after annotations above functions #267

Open
voithos opened this issue Jan 11, 2024 · 1 comment
Open
Labels
bug Something isn't working formatter
Milestone

Comments

@voithos
Copy link

voithos commented Jan 11, 2024

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

@Scony Scony added bug Something isn't working formatter labels Jan 11, 2024
@Scony
Copy link
Owner

Scony commented Jan 11, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter
Projects
Status: No status
Development

No branches or pull requests

2 participants