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
Support ignoring AST nodes using a comment, for specific node types.
Originally, I had hoped to support ignoring any type of node by simply including a comment before the node. That turned out to be infeasible due to an existing reliance on eventually visiting every TokenSyntax in the AST. For example, some nodes attach printing tokens before or after TokenSyntax instances that will be visited later. In the event that a TokenSyntax is ignored, those attached before/after tokens are also ignored leading to mismatches in the token stream.
Rather than to fix all such instances of that dependency, which may not itself be feasible, I've instead limited the ignore directive to 2 "top level" types of nodes: code block list items and member decl list items. This allows ignoring on an entire statement or member.
Verbatim token changes:
I had to add a new option on `Verbatim` to support only indenting the first line of the text contained in the token. Originally, verbatim always printed the indentation of the current context on every line of text. That breaks when verbatim is used to print text that's nested in other decls. Each time the formatter runs, the verbatim text is indented by its original indentation + the indentation of the current context.
0 commit comments