You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jsonnetfmt.Format makes a lot of good logic in the internal method without exposing as methods.
This results in disability to use custom-written formatters and get the best from jsonnetfmt, requiring to pipe results to jsonnetfmt after any changes, which is more frustrating when we already have ast.Node and do not need to unparse it again.
Let's expose everything Format does as a new method FormatNode(root ast.Node, finalFodder ast.Fodder, options formatter.Options) and keep initial Format() as a wrapper that does AST and applies FormatNode to it?
The text was updated successfully, but these errors were encountered:
m-messiah
changed the title
formatter.Unparser keeps initial newline
formatter.Format is not applicable to ast.Node
Feb 22, 2023
jsonnetfmt.Format makes a lot of good logic in the internal method without exposing as methods.
This results in disability to use custom-written formatters and get the best from jsonnetfmt, requiring to pipe results to jsonnetfmt after any changes, which is more frustrating when we already have ast.Node and do not need to unparse it again.
Let's expose everything Format does as a new method
FormatNode(root ast.Node, finalFodder ast.Fodder, options formatter.Options)
and keep initial Format() as a wrapper that does AST and applies FormatNode to it?The text was updated successfully, but these errors were encountered: