-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Interactive scaladoc: demand new typer run when done. #2387
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
We'll also take reviews from @huitseeker |
@@ -856,9 +856,9 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") | |||
/** Implements CompilerControl.askDocComment */ | |||
private[interactive] def getDocComment(sym: Symbol, source: SourceFile, site: Symbol, fragments: List[(Symbol,SourceFile)], | |||
response: Response[(String, String, Position)]) { | |||
informIDE(s"getDocComment $sym at $source site $site") | |||
informIDE(s"getDocComment $sym at $source; site $site; fragments $fragments") |
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.
Have you consider something like
fragments.groupBy(_._2).map(
(sfile,symbls) => "%s in %s".format(symbls.map(_._1), sfile)
).join(", ")
to avoid logfile clutter ?
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.
I agree fragments logging would be too much of a clutter. Given that symbol -> source file mapping is almost 1:1 in stdlib, I think I'd better remove this info at all.
I don't include the test here,however I see test failures disappear on the IDE side. The caches are dropped on a new run, so this change fixes the problem. |
@@ -856,9 +856,9 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") | |||
/** Implements CompilerControl.askDocComment */ | |||
private[interactive] def getDocComment(sym: Symbol, source: SourceFile, site: Symbol, fragments: List[(Symbol,SourceFile)], | |||
response: Response[(String, String, Position)]) { | |||
informIDE(s"getDocComment $sym at $source site $site") | |||
informIDE(s"getDocComment $sym at $source, site $site") |
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.
[nitpicking]
Have you considered something like
fragments.groupBy(_._2).map(
(sfile,symbls) => "%s in %s".format(symbls.map(_._1), sfile)
).join(", ")
to avoid logfile clutter ?
[/nitpicking]
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.
Unfortunately that would still be too much: as symbols mostly come from different SourceFiles grouping is not benefitial.
While it's true I see less spurious chokage in the IDE thanks to this, I'm afraid this has a performance price in interactive situations. For that reason and maintenance purposes, I'd love to see a code comment at the |
As of now, when backgroundCompile is in the same typer run as scaladoc-fetching logic, typer is confused with stale symbols.
@huitseeker done adding the comment. |
Interactive scaladoc: demand new typer run when done.
As of now, when further backgroundCompile is in the same typer run as
scaladoc-fetching logic, it gets confused with stale symbols.
Please check if there are other inconsistencies in this PC method.
Review by @odersky.