fix(rewrite): Handle formatting of json comments when adding new resourc... #58
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.
...e roots
Add new method addCommaToLine(args) which allows you to find a line in a file
and add a terminating comment char at a specified offset from that line. Uses
same methods as in rewrite(args).
This solves the issue where new resource roots required a comma at the beginning of the line which did not look pretty.
Fixes #55 #57
This works great when using a clever editor like sublime, but if you're a poor sole that uses NotePad then there is still an issue with windows carriage returns in rewrite() that I don't have time to get to the bottom now... I think we should just leave it - and maybe even remove all concerns about windows carriage returns. i.e. ignore doing this:
lines[otherwiseLineIndex] += "\r";
No harm in having it in there though.