-
Notifications
You must be signed in to change notification settings - Fork 465
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Description
In the SyntaxRewriter implementation, I noticed that many visit methods are written in the following format:
open func visit(_ node: AttributeListSyntax) -> AttributeListSyntax {
return Syntax(visitChildren(node)).cast(AttributeListSyntax.self)
}Since the node argument is already of type AttributeListSyntax, and the visitChildren(node) method returns the same type, the type casting using .cast(AttributeListSyntax.self) appears to be redundant and unnecessary.
Suggested Improvement:
Consider refactoring the generated visit methods to remove this redundant type casting and Syntax wrapping. The improved version would look like:
open func visit(_ node: AttributeListSyntax) -> AttributeListSyntax {
return visitChildren(node)
}This simplification would make the codebase cleaner, more readable, and reduce potential points of failure.
natikgadzhi
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers