-
Notifications
You must be signed in to change notification settings - Fork 1.1k
sort output of definitions in repl, fixes #8677 #9005
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
/edit: changing the reporting is no longer part of this PR |
vals.map(rendering.renderVal).flatten | ||
).foreach(str => out.println(SyntaxHighlighting.highlight(str))) | ||
val formattedMembers = ( | ||
typeAliases.map(ta => ("// defined alias " + ta.symbol.showUser, ta.symbol.coord.toSpan)) ++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can directly call span
on a Symbol
b137f3f
to
9d11cf6
Compare
3a1a3b0
to
78adcc8
Compare
@smarter please note the updated description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM!
@@ -264,7 +280,7 @@ class ReplDriver(settings: Array[String], | |||
name.startsWith(str.REPL_RES_PREFIX) && hasValidNumber && sym.info == defn.UnitType | |||
} | |||
|
|||
def displayMembers(symbol: Symbol) = if (tree.symbol.info.exists) { | |||
def displayMembers(symbol: Symbol): (State, Seq[Diagnostic]) = if (tree.symbol.info.exists) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to something else like formatMembers
since it doesn't directly display anything anymore?
@@ -323,7 +323,7 @@ class ReplDriver(settings: Array[String], | |||
.find(_.symbol.name == newestWrapper.moduleClassName) | |||
.map { wrapperModule => | |||
val formattedTypeDefs = typeDefs(wrapperModule.symbol) | |||
val (newState, formattedMembers) = displayMembers(wrapperModule.symbol) | |||
val (newState, formattedMembers) = extractAndFormat(wrapperModule.symbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
val (newState, formattedMembers) = extractAndFormat(wrapperModule.symbol) | |
val (newState, formattedMembers) = extractAndFormatMembers(wrapperModule.symbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are too fast -- I already changed it locally but haven't pushed yet :)
f8c3a63
to
2f5bc4f
Compare
2f5bc4f
to
f5db076
Compare
f5db076
to
34371fa
Compare
There was one test failure in the worksheet tests which I didn't see before. Also, I squashed all code changes together. Hopefully CI now becomes green. |
@smarter should be ready to merge now :) |
As opposed to the earlier version, this PR now only fixes #8677, which makes it much smaller.
Note that this change basically reverts d9549fa, which order output on a lower level, but the new order should still be deterministic. This is the reason I had to change some of the tests: the order is no longer alphabetical there.