Fix removing first method in class #538
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when following by a multi-line node.
Previously, trying to remove the first method in a module/class when there was another method after it would also remove all but the last line of the following method as well. The problem can be seen below:
To account for blank lines, the end_line of the node to remove needs to be adjusted to include all lines upto the start of the next node, whereas the code was previously including all lines upto the end of the next node.