Skip to content

sway-fmt-v2 should be able to handle indentations correctly. #1888

@kayagokalp

Description

@kayagokalp

Since we are building the formatted code from AST items we may need to have a common way of building the formatted code (something like a CodeBuilder that keeps track of the current indentation level). So that we can build the code with correct indentations.

I can see this kind of logic is present in the current formatter but would love to discuss if there are other ways we can reconstruct the code with correct indentations.

If this is indeed something we need I can implement it before #1873

cc @eureka-cpu

Metadata

Metadata

Assignees

Labels

P: highShould be looked at if there are no critical issues leftforcformatter

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions