Add insert_* overloads that accept both location and end_location

This commit is contained in:
fn ⌃ ⌥ 2021-10-26 21:09:32 -07:00
parent e8c0f49cb8
commit 3b11491cea

View file

@ -21,6 +21,14 @@ class Ameba::Source
@rewriter.remove(loc_to_pos(location), loc_to_pos(end_location) + 1)
end
def insert_before(location, end_location, content)
@rewriter.insert_before(loc_to_pos(location), loc_to_pos(end_location) + 1, content)
end
def insert_after(location, end_location, content)
@rewriter.insert_after(loc_to_pos(location), loc_to_pos(end_location) + 1, content)
end
def insert_before(location, content)
@rewriter.insert_before(loc_to_pos(location), content)
end