class Ameba::Source::Corrector
- Ameba::Source::Corrector
- Reference
- Object
Overview
This class takes source code and rewrites it based on the different correction actions supplied.
Defined in:
ameba/source/corrector.crConstructors
Instance Method Summary
-
#insert_after(location, end_location, content)
Shortcut for
#wrap(location, end_location, nil, content)
-
#insert_after(range : Range(Int32, Int32), content)
Shortcut for
#wrap(range, nil, content)
-
#insert_after(pos : Int32, content)
Shortcut for
#insert_after(...pos, content)
-
#insert_after(node : Crystal::ASTNode, content)
Shortcut for
#wrap(node, nil, content)
-
#insert_after(location, content)
Shortcut for
#insert_after(location, location, content)
-
#insert_before(location, end_location, content)
Shortcut for
#wrap(location, end_location, content, nil)
-
#insert_before(range : Range(Int32, Int32), content)
Shortcut for
#wrap(range, content, nil)
-
#insert_before(pos : Int32, content)
Shortcut for
#insert_before(pos.., content)
-
#insert_before(node : Crystal::ASTNode, content)
Shortcut for
#wrap(node, content, nil)
-
#insert_before(location, content)
Shortcut for
#insert_before(location, location, content)
-
#process
Applies all scheduled changes and returns modified source as a new string.
-
#remove(location, end_location)
Shortcut for
#replace(location, end_location, "")
-
#remove(range : Range(Int32, Int32))
Shortcut for
#replace(range, "")
-
#remove(node : Crystal::ASTNode)
Shortcut for
#replace(node, "")
-
#remove_leading(location, end_location, size)
Removes size characters from the beginning of the given range.
-
#remove_leading(range : Range(Int32, Int32), size)
Removes size characters from the beginning of the given range.
-
#remove_leading(node : Crystal::ASTNode, size)
Removes size characters from the beginning of the given node.
-
#remove_preceding(location, end_location, size)
Removes size characters prior to the source range.
-
#remove_preceding(range : Range(Int32, Int32), size)
Removes size characters prior to the source range.
-
#remove_preceding(node : Crystal::ASTNode, size)
Removes size characters prior to the given node.
-
#remove_trailing(location, end_location, size)
Removes size characters from the end of the given range.
-
#remove_trailing(range : Range(Int32, Int32), size)
Removes size characters from the end of the given range.
-
#remove_trailing(node : Crystal::ASTNode, size)
Removes size characters from the end of the given node.
-
#replace(location, end_location, content)
Replaces the code of the given range with content.
-
#replace(range : Range(Int32, Int32), content)
Replaces the code of the given range with content.
-
#replace(node : Crystal::ASTNode, content)
Replaces the code of the given node with content.
-
#wrap(location, end_location, insert_before, insert_after)
Inserts the given strings before and after the given range.
-
#wrap(range : Range(Int32, Int32), insert_before, insert_after)
Inserts the given strings before and after the given range.
-
#wrap(node : Crystal::ASTNode, insert_before, insert_after)
Inserts the given strings before and after the given node.
Constructor Detail
Instance Method Detail
Shortcut for #wrap(location, end_location, nil, content)
Shortcut for #wrap(location, end_location, content, nil)
Removes size characters from the beginning of the given range. If size is greater than the size of the range, the removed region can overrun the end of the range.
Removes size characters from the beginning of the given range. If size is greater than the size of the range, the removed region can overrun the end of the range.
Removes size characters from the beginning of the given node. If size is greater than the size of the node, the removed region can overrun the end of the node.
Removes size characters prior to the source range.
Removes size characters prior to the source range.
Removes size characters prior to the given node.
Removes size characters from the end of the given range. If size is greater than the size of the range, the removed region can overrun the beginning of the range.
Removes size characters from the end of the given range. If size is greater than the size of the range, the removed region can overrun the beginning of the range.
Removes size characters from the end of the given node. If size is greater than the size of the node, the removed region can overrun the beginning of the node.
Replaces the code of the given range with content.
Inserts the given strings before and after the given range.
Inserts the given strings before and after the given range.
Inserts the given strings before and after the given node.