Skip to content

Improve Xprint #1345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2016
Merged

Improve Xprint #1345

merged 1 commit into from
Jul 17, 2016

Conversation

nicolasstucki
Copy link
Contributor

  • Dont reprint a tree that hasn't changed.
  • Highlight changes in yellow.

@nicolasstucki
Copy link
Contributor Author

This PR will add Unchanged since ... rather than reprinting the tree.
screen shot 2016-06-30 at 14 56 14

It will also show the parts of the tree that have changed in yellow.
screen shot 2016-06-30 at 14 55 57

@DarkDimius
Copy link
Contributor

Awesome job! 🌟

@DarkDimius
Copy link
Contributor

DarkDimius commented Jun 30, 2016

ping @adriaanm, you may be interested to port this.

@xeno-by
Copy link

xeno-by commented Jun 30, 2016

Wow not bad.

@nicolasstucki
Copy link
Contributor Author

New version will mark additions in green and modifications in yellow.
screen shot 2016-06-30 at 17 07 34

With -Xprint-diff-del deleted parts are inserted in red and modified parts are inserted in magenta (just before a yellow modification).
screen shot 2016-06-30 at 17 06 49

@adriaanm
Copy link
Contributor

Cool! Yeah we should port this over once 2.12.0 is out

@nicolasstucki nicolasstucki force-pushed the improve-Xprint branch 2 times, most recently from ac07131 to 8e2e4af Compare July 1, 2016 14:10
@DarkDimius DarkDimius mentioned this pull request Jul 2, 2016
@nicolasstucki nicolasstucki changed the title Improve Xprint Fix #1312: Improve Xprint Jul 4, 2016
@nicolasstucki nicolasstucki changed the title Fix #1312: Improve Xprint Improve Xprint Jul 15, 2016
}
}

private def mkColoredDiffTree(treeString: String, lastTreeSting: String): String = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to factor this out to a module reusable from other parts of compiler.
This logic doesn't seem specific to Run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted it to dotty/tools/dotc/util/DiffUtil.scala

@DarkDimius
Copy link
Contributor

otherwise LGTM

* Do not reprint a tree that has not changed.
* Highlight changes with yellow and insertions in green.
* -Xprint-diff-del: Inserts the deleted parts of the tree in red
  and the parts that where changed in magenta.
@DarkDimius
Copy link
Contributor

LGTM. Glad to have this merged.

@DarkDimius DarkDimius merged commit 9da40cb into scala:master Jul 17, 2016
@allanrenucci allanrenucci deleted the improve-Xprint branch December 14, 2017 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants