[feat] Use original source for methods and fields #97
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.
Fix #95
This PR is a bit of a monster, so I'll squash it. I just don't have time to make it pretty.
The major feature of this PR is that the PcsInterpreter has been changed to keep track of which revisions appear in which subtrees. If a subtree is found to contain only a single revision, then the interpreter sets metadata on the node to indicate that.
When the pretty printer finds such metadata on a method or field node, it does not attempt to print it but instead extracts the original source code and prints that, all the while attempting to match indentation. It seems like it works.
Checking pretty print vs reparsed pretty print in tests no longer works as a result of this, however.
The ContentMerger has also been refactored not to have any side effects, which was necessary to make this all work. The source code extraction functionality of the pretty printer has been moved to a separate class.