Skip to content

Rewrite the formatter to make it more robust #250

Description

@NathanLovato

I'm opening this issue to let you know that I'm in the process of rewriting the formatter to have more reliable architecture and enable support for features like #187. After talking to the Godot maintainers, this is looking to be a more long-lived project than I originally hoped or anticipated, and for that the code needs to be better.

I'll document the architecture once it's finalized, but the idea is to get rid of some dependencies and have a more traditional formatter that walks the parsed tree of GDScript code and builds an intermediate representation of the formatted code before outputting it.

This is what Topiary, the dependency this formatter has been using, and many formatters generally do, but we need to write our own version of it to have more control over the output and really nail automated long line wrapping or bring some of the features some people would like (e.g. configurable number of lines between functions or number of hanging indents in continuation lines).

I'm actively working on this (in my spare time) and I'll add the code once the formatting is OK and some new features are implemented, as I'm just tackling it all together in one big batch for development efficiency.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions