-
Notifications
You must be signed in to change notification settings - Fork 338
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
improvement: clear diagnostics in downstream targets #6604
Conversation
@@ -101,7 +105,7 @@ final class Compilations( | |||
result <- targetOpt match { | |||
case None => Future.successful(empty) | |||
case Some(target) => | |||
compileBatch(target) | |||
compileBatch(target) // HERE |
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.
compileBatch(target) // HERE | |
compileBatch(target) |
|
||
import ch.epfl.scala.bsp4j.BuildTargetIdentifier | ||
|
||
class BuildTargetMapper { |
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.
class BuildTargetMapper { | |
class PreviouslyCompiledTargets { |
?
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.
Not perfect, but I don't have a better name. I also added a comment, because the whole logic may not be that obvious. Can you check if it is understandable?
val targets = for { | ||
path <- diagnostics.keySet | ||
targets <- buildTargets.sourceBuildTargets(path) | ||
if targets.forall(inverseDeps.apply) |
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.
if targets.forall(inverseDeps.apply) | |
if targets.exists(inverseDeps.apply) |
?
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.
Just some minor comments left. Great work!
metals/src/main/scala/scala/meta/internal/metals/Compilations.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Diagnostics.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/Compilations.scala
Outdated
Show resolved
Hide resolved
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.
LGTM!
when compilation in a upstream target failed. We don't do it for Scala 3 best effort compilation, for which even if compilation fails upstream often downstream projects will also get recompiled.
resolves: #2670