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
Copy file name to clipboardExpand all lines: docs/plugins.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -558,8 +558,7 @@ This plugin will search through every LiteralExpression in the entire project, a
558
558
559
559
Another common use case is to remove print statements and comments. Here's a plugin to do that:
560
560
561
-
Note: Comments are not regular nodes in the AST, so to visit comments, there is an additional requirement to specify
562
-
that the AST walk should also `visitComments`. In the case of comments, the first argument of the visitor function is a `Token`, not an `AstNode`.
561
+
Note: Comments are not regular nodes in the AST. They're considered "trivia". To access them, you need to ask each AstNode for its trivia. to help with this, we've included the `AstNode` visitor method. Here's how you'd do that:
0 commit comments